这个问题已经被回答过几次了,但是答案对我不起作用。我最近重新安装了Windows 10,因此XAMPP的安装是干净的,但以前可以在我的最后一台PC上使用。rewrite_module已启用。
当我转到时http://localhost
,我的应用程序将我重定向到http://localhost/login
,但显示404直到我键入http://localhost/index.php/login
我的config.php
$config['base_url'] = 'http://localhost';
$config['index_page'] = '';
在codeigniter根文件夹的.htaccess文件中:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
我尝试的解决方案:
答案2(这给我“找不到对象!”错误)
我修改了.htaccess文件,添加了以下这一行:
RewriteBase /YOURPROJECTFOLDER/
所以:
RewriteEngine on
RewriteBase /ShopCaseCodeigniter/
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句