【发布时间】:2017-02-21 17:26:49
【问题描述】:
在我的根目录中,我有 .htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
从 url 中删除 index.php。
在我的 routes.php 文件中,我有:
$route['default_controller'] = 'absolventi';
$route['absolventi'] = 'absolventi';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
默认控制器有效,但将 /absolventi 添加到域则无效。请求的每个文件都返回未找到的文件。 ajax 调用也会返回。
我尝试更改为 $route['absolventi'] = 'index.php/absolventi'; 以查看 .htaccess 是否覆盖 index.php 但仍然是相同的错误。真的不知道还能做什么。任何帮助,建议将不胜感激。如果需要更多信息,请询问。
【问题讨论】:
-
是否启用了 mod_rewrite?
标签: php .htaccess codeigniter routing host