Codeigniter URL not working without index.php

最后都变了- 提交于 2019-12-01 18:54:47

The most common solution to this problem is usually the missing question mark ? after index.php in .htaccess, so

RewriteRule ^(.*)$ index.php/$1 [L]

should be

RewriteRule ^(.*)$ index.php?/$1 [L]

E.G. on my Windows XAMPP, I do not need the "?", but in a Linux hosting environment it is usually required.

i aggree with Vlakarados, but i will share my .htaccess setting

RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]

its work perfectly.

i hope that's work to for your CI website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!