2012-09-23 71 views
3

我已在我的.htacces文件中進行了設置,以便任何試圖訪問該網站的人都被重定向到index.html,這是一個正在建設中的頁面。我對那裏的圖像,這並不顯示COS的鏈接被重定向到index.html的,我如何從規則中排除圖像,路徑是/images/underConstruction.png.從重定向重寫規則中排除圖像文件夾

RewriteEngine On 
RewriteCond %{REQUEST_URI} !=/index.html 
RewriteRule^/index.html [R=301] 
+0

試試這個: 的http:// stackover flow.com/questions/1848500/htaccess-mod-rewrite-how-to-exclude-directory-from-rewrite-rule – androbin

回答

3

添加一個排除條件你的規則:

RewriteEngine On 
RewriteCond %{REQUEST_URI} !=/images/ 
RewriteCond %{REQUEST_URI} !=/index.html 
RewriteRule^/index.html [R=301] 
+0

感謝您的幫助。很抱歉,遲到接受。 – RSM

1

嘗試加入這一行

RewriteRule ^images/ - [L] 
+0

如果我把它放在最後一行不工作,如果我把它放在最後一行之上,它的一個重定向循環 – RSM