【问题标题】:Page not found error when trying to access index controller in Codeigniter尝试访问 Codeigniter 中的索引控制器时找不到页面错误
【发布时间】:2014-05-31 05:22:25
【问题描述】:

在我的 codeigniter 项目中,我正在使用 htaccess 文件从 URL 中删除 index.php 扩展名。但这给了我

404 (Page Not Found) Error

尝试访问Index 控制器中的页面/功能时。我试图加载一个页面,http://site.org/projectname/index/language/french,这给了我这个错误。

我的 htaccess 代码:

RewriteEngine On
RewriteBase /projectname/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

谁能帮我解决这个问题?提前致谢。

【问题讨论】:

    标签: php .htaccess codeigniter


    【解决方案1】:

    这样试试

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^(.*)$ index.php/$1 [L]
    

    你必须在index.php之前删除/

    【讨论】:

      猜你喜欢
      • 2015-11-04
      • 1970-01-01
      • 2017-01-12
      • 2013-05-25
      • 1970-01-01
      • 1970-01-01
      • 2010-10-17
      • 2019-07-01
      • 1970-01-01
      相关资源
      最近更新 更多