我看了很多文章并尝试了不同的方法,但它仍然不起作用。
现在我的 URL 看起来像mysite.com/index.php/[controller]
. 目标是mysite.com/[controller]
。
在config.php中:
$config['index_page'] = "";
$config['uri_protocol'] = 'REQUEST_URI';
我的.htaccess文件包含
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
在我的 Apache 服务器中也启用了mod_rewrite 。
还有其他解决方案吗?