0
我試圖刪除proxy.php文件和傳遞給它的參數。這就是它目前的樣子。htaccess刪除參數和索引文件
http://localhost/stuff/proxy.php?parameter=folder01/some.file
這是我希望它看起來的樣子。
http://localhost/stuff/folder01/some.file
對於我的htaccess文件,我嘗試了以下,但他們不工作。
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /proxy.php?parameter=$1 [L]
這
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/?$ /proxy.php?parameter=$1 [L,QSA]
任何想法?
這不適合我。我試過根目錄和東西目錄。我訪問網址時沒有任何變化。 – 12shadow12
你是否在東西目錄中試過它,在東西目錄中使用它,並刪除'RewriteBase/stuff /'。 –
我將htaccess移到了東西目錄並刪除了RewriteBase。什麼也沒有發生,這很奇怪。而且我有mod_rewrite啓用 – 12shadow12