我試圖使用htaccess重定向到一個文件,但無法獲取圖像顯示。htaccess重定向但排除圖像
我想重定向到mydomain.com或www.mydomain.com任何要求www.mydomain.com/test.html
這是我的htaccess文件的內容:
# Turn rewriting on
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/test.html
RewriteCond %{REQUEST_URI} !=*\.png$ [NC]
RewriteRule .* /test.html
我在我的test.html文件放在這行代碼:
<img src="image.png" alt="My Image">
但圖像不顯示在所有的,我只是得到一個破碎的形象。我也嘗試使用圖像的絕對路徑,同樣的事情。
真棒,就像一個魅力!非常感謝你! – user1078494 2011-12-27 21:45:42
+1更簡潔。 – 2011-12-27 21:48:23