2011-11-24 73 views
1

我有以下重寫(爲了發佈目的而修剪它)。我如何定位上面的目錄(../,或搜索引擎的點點斜線)?我試圖逃避時間\ \。 (沒有空間,Stackoverflow不喜歡它顯然),雖然我仍然得到一個HTTP 404錯誤。我確信這很簡單,雖然我沒有在網上找到任何東西,但有人得到了一個工作答案。Apache dot dot斜槓重寫

RewriteEngine on 
RewriteRule ^(path1\/|path2\/) - [L] 
RewriteRule !\.(css|cur|gif|gz|xhtml)$ index.php 

編輯 這個工作只在目錄中,我們如何能夠調整,以便它適用於所有目錄中的文件呢?

RewriteRule .*\/scripts\/*$ scripts\/$1 [L] 
+1

你需要接受的回答前面的問題,如果你希望人們繼續回答您的問題。 –

+1

感謝克里斯,仍然掌握了這一點。 – John

回答

1
RewriteEngine on 
RewriteRule .*\/scripts(.+) scripts$1 [QSA]