如何從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