如何从urls中删除'index.php',如果控制器文件夹中有一些控制器,子文件夹中有一个? 比如我的前端URL看起来是这样的:domain.com/site/contact.html 我想我的后端的网址是这样的:domain.com/system/settings/profile.html,其中系统不控制器,只有控制器文件夹中的子文件夹。 当我输入domain.com/index.php/system/settings/profile.html,一切正常,它只是看起来不正确。 下面是在我的routes.php文件文件:Codeigniter - 子文件夹中的控制器,从url中删除index.php
$route['default_controller'] = "site";
$route['system'] = "system/login";
$route['404_override'] = 'errors/error_404';
下面是在我的.htaccess文件:
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|public|tmp|download|javascript|rte|document|xajax_js|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
感谢。
这也不起作用。我会在.htaccess文件中需要某种异常。不管怎么说,还是要谢谢你。 – 2012-08-13 16:50:04