2
問題是我需要重定向到projects.test.net/rr/index.php,如果我來到站點的根目錄,它是http://projects.test.net/rr/.htaccess從站點根目錄重定向到index.php
爲什麼第一個重寫規則不起作用?我也試過添加
RewriteCond %{HTTP_HOST}^projects.pepperit.net/rr/ [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
但它不工作。整個文件在這裏:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST}^projects.test.net/rr/$ [NC]
RewriteRule ^(.*)$http://projects.test.net/rr/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
設置爲什麼不是index.php文件設置爲標準目錄索引? –
謝謝,添加「DirectoryIndex index.php」修復了一切。 – The50
也作爲答案添加,也許你可以標記爲解決方案:) –