找不到图像名称

时间:2011-08-28 19:50:57

标签: image .htaccess replace http-status-code-404

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$ 
RewriteRule .* /not/found/image [L]

这是我用来替换任何未找到的图像的代码,但是假设我只想替换名为image01.jpg的图像并且找不到它。我如何只替换该图像名称?

先谢谢坦率地说:)

1 个答案:

答案 0 :(得分:1)

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} image01\.jpg$ 
RewriteRule .* /not/found/image [L]