我需要从我的codeigniter网址中移除index.php。这是我在.htaccess文件代码:无法从活动网站中的codeigniter网址中移除index.php
RewriteEngine On
RewriteRule ^index.php/(.*)$ /$1 [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
和config.php文件修改:
$config['base_url'] = 'http://example.com/'
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
在我的本地工作的罚款。但在我的生活网站,它会产生一个404错误。
我可以通过index.php('http://example.com/index.php/Home')加载url,但'http://example.com/Home'生成404错误。为什么这只发生在现场?还有其他需要改变吗? 一两件事,它不是一个Apache服务器,我的网站发表在IIS
尝试从第二行 – shashi
删除[R = 302,L]仅适用于现场?如果我从我的代码中删除它将重定向到我的仪表板在本地主机 – geeth
该网站发布在IIS – geeth