我很努力去除我的CodeIgniter URL的'index.php'部分。 我正在使用CodeIgniter版本3.1.2。我已经按照有关其他问题的所有步骤一下:从CodeIgniter URL中删除index.php
- 改变
$config['index_page'] = 'index.php'
到$config['index_page'] = ''
- 改变
$config['uri_protocol'] = 'AUTO'
到$config['uri_protocol'] = 'REQUEST_URI'
- 加在我用下面的代码项目的根文件夹中的.htaccess文件:
RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA]
然而,当我尝试访问我的网站,我得到的以下错误代码。
未找到
所请求的网址/ Toneel /网站/指数在此服务器上未找到。
重写模块在我的Apache服务器中打开。 任何人都可以帮我解决这个问题吗?
RewriteEngine叙述后添加RewriteBase/your_project_name在本地主机,只是RewriteBase /运行时,当你的代码上传到服务器上。 – Omi