http://localhost/codeigniter/index.php/user/main_page
如何从此网址中删除index.php?
答案 0 :(得分:1)
答案 1 :(得分:0)
答案在帖子中说明这个问题是完整的。
肖恩·维埃拉的回答:
如果您使用Apache,请在根网站中放置.htaccess文件 包含以下内容的目录:
RewriteEngine on RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L]
另一个好的版本位于:
答案 2 :(得分:0)
试试这个:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
替换:
$config['index_page'] = "index.php"
to
$config['index_page'] = ""
if it still not work try to replace:
$config['uri_protocol'] = "AUTO"
//replace with the below code
$config['uri_protocol'] = "REQUEST_URI"
了解更多详情:http://w3code.in/2015/09/how-to-remove-index-php-file-from-codeigniter-url/请查看