【问题标题】:Strange behaviour with .htaccess and CodeIgniter controller URLs.htaccess 和 CodeIgniter 控制器 URL 的奇怪行为
【发布时间】:2014-08-22 17:21:02
【问题描述】:

对于我网站中的任何 URL,我 htaccess 中的以下代码似乎总是对我有用。

RewriteCond $1 !^(index\.php|images|css|robots\.txt|js|files|icons|fonts|extplorer|static|google)
RewriteRule ^(.+)$ /index.php?/$1 [L,QSA]

但现在我遇到了一个奇怪的行为,只有控制器的索引才能工作。 所以http://www.website.com/controller 可以,但是http://www.website.com/controller/method 给了我:

Fatal error: Class 'CI_Controller' not found in /home/interess/public_html/system/core/CodeIgniter.php on line 233

有什么想法吗?

【问题讨论】:

  • 你有自定义路由规则设置吗?
  • 不。只有一个 default_controller。
  • 您在配置文件中的base_url 设置是什么?
  • http://www.example.org/ - 直到昨天一切正常。我今天进去了,这开始发生了。已经在htaccess上尝试了一堆东西,没有运气。 :(

标签: php .htaccess codeigniter


【解决方案1】:

发现问题。在几乎把我的眼皮拔掉之后,发现是 $config['csrf_protection'] 设置导致了这种最奇怪的行为。

【讨论】:

    猜你喜欢
    • 2020-11-06
    • 1970-01-01
    • 2016-12-27
    • 1970-01-01
    • 1970-01-01
    • 2014-12-14
    • 2020-03-31
    • 2015-11-07
    • 1970-01-01
    相关资源
    最近更新 更多