我很努力去除我的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