1
root/.htaccess
RewriteEngine on
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
它完美地將所有請求(除了文件和文件夾)到的index.php。我需要它也可以用於我的子文件夾。
我的.htaccess中的子文件夾root/demos/project
包含:
RewriteOptions inherit
,但不起作用。
我試試這根/的.htaccess
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
RewriteRule ^demos/project/(.*)$ demos/project/index.php/$1 [QSA,L]
不工作。
這樣的:
RewriteRule ^demos/project/(.*)$ demos/project/index.php/$1 [QSA,L]
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
得到內部服務器錯誤 'missconfiguration'
,並多了幾分方式,但一切我想,我只是得到這些:501(從服務器默認)和404(從CI在根中);
我在root
和demos/project
都使用codeigniter,只是想從兩個'隱藏'index.php,如何正確地做到這一點?
謝謝。
內部服務器錯誤'missconfiguration'。 :( – egig
看到我的編輯,當我刪除2請求時它工作嗎? –
還是一樣的:'500內部服務器錯誤'。我添加.htaccess到我的子文件夾太類似sintax,我試過的一切,我只得到這些:500或404。當你得到404它應該工作。 – egig