我有以下网址..
http://localhost/ci/site_controller/home
我想从url中删除site_controller控制器导致..
http://localhost/ci/home
我怎么能在CodeIgniter中这样做?
注意:如果你因为我不知道如何使用mod_rewrite,你会问我尝试过的东西,而不是我刚刚搜索谷歌.
编辑
我在我的routes.PHP中有这个
$route['default_controller'] = "site_controller/home"; $route['ci/home'] = 'ci/site_controller/home'; $route['404_override'] = '';
但还是不行!
的.htaccess
RewriteEngine On RewriteBase /ci/ RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$/index.PHP/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$index.PHP/$1 [L] ErrorDocument 404 /index.PHP