【发布时间】:2019-12-09 17:04:31
【问题描述】:
这是我的在线托管目录结构
-- /
-- up
-- .logs
-- public_html
-- application
-- system
-- user_guide
-- .htaccess
-- DO_NOT_UPLOAD_HERE
在我的 config.php 中,我写了这段代码:
$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'].'/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
在我的 .htaccess 文件中,我有以下代码:
<IfModule mod_php5.c>
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
我试图从我的 URL 中删除 index.php,所以它会显示 mydomain.com/class/controller 而不是 mydomain.com/index.php/class/controller
它在我的本地主机中运行顺利,我使用的是带有 LAMPP 服务器的 Ubuntu 15.10。但是,当我在线尝试所有代码时,它显示了 404 错误页面。
这是我即将上线的网站:onesource.esy.es
我的代码有什么问题?
【问题讨论】:
标签: .htaccess codeigniter