有没有人在互联网和网络发展的历史中,能够摆脱codeIgniter中的mod_rewrite的"index.php".
我已经尝试了几天,似乎没有任何工作.
我正在使用这个(在.htaccess文件中):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
Run Code Online (Sandbox Code Playgroud)
不知道我在哪里得到它,但它适用于我的codeigniter安装,本地和现场.不要忘记$config['index_page'] = '';在配置文件中设置.