Php Codeigniter网站404错误/.htaccess
我正在尝试使用codeigniter,我构建了一个在本地运行良好的小型web,但当我上传到我的免费主机()时,它就不工作了。我想这是因为.htaccess和我正在阅读并尝试一些.htaccess配置,但仍然不起作用 我的CodeIgniter项目位于mydomain/admin中,因为web的其余部分不是CodeIgniter: my config.php的一些选项Php Codeigniter网站404错误/.htaccess,php,codeigniter,.htaccess,Php,Codeigniter,.htaccess,我正在尝试使用codeigniter,我构建了一个在本地运行良好的小型web,但当我上传到我的免费主机()时,它就不工作了。我想这是因为.htaccess和我正在阅读并尝试一些.htaccess配置,但仍然不起作用 我的CodeIgniter项目位于mydomain/admin中,因为web的其余部分不是CodeIgniter: my config.php的一些选项 $config['base_url'] = 'http://whereis.hol.es/admin'; $config['ind
$config['base_url'] = 'http://whereis.hol.es/admin';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '.html';
最后一个.htaccess,我会尽量简单地理解它
RewriteEngine on
RewriteCond $1 !^(index\.php|images|swf|uploads|js|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
这是我第一次使用htaccess文件,我是通过阅读来学习的,但我的网站无法在线。我不确定.htaccess文件放在哪里:
-/我的网站
-/我的codeigniter(管理员)
-应用程序代码点火器文件夹(管理员/应用程序)
PD:当我尝试加载管理时,它重定向到我的控制器登录,但显示404错误:
404找不到页面
The page you requested was not found.
在.htaccess文件中使用以下代码
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
谢谢你,拉塞尔。这个htaccess并没有从url中删除index.php,我可以加载admin/index.php/login,但不能加载admin/loginSorry,它工作正常,谢谢Russell。现在我在查找模型时遇到了问题,但可能是代码。