我遇到重定向問題。現在我有一個網頁地址,如:Apache - 重定向 - 路徑
http://localhost/Stella/Wiki/index.php
而且在同一目錄下,我有我.htaccess
文件,它應該重定向到index.php
所有請求。
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/Stella/Wiki/index.php
RewriteRule (.*)$ /Stella/Wiki/index.php?id=$1 [L,QSA]
這種重定向的作品真的很好,但我想在相對的方式來使用它,比如:
RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule (.*)$ /index.php?id=$1 [L,QSA]
就像沒有絕對路徑,因爲我將有很多的子文件夾,和我不我想要有如下長規則:/xxx/xxx/xxx/xxx/index.php
。
你能幫我解決這個問題嗎?我不知道該怎麼辦,或者甚至有可能?