开发者

How do I redirect a not found FLV file to a 404 FLV file, using .htaccess?

Using .htaccess, how do I permanently redirect all not found *.flv files in one directory to a 404.flv f开发者_JAVA百科ile in the same directory. For example:

If this file is not found: example.com/flv/*.flv

Use this file: example.com/flv/404.flv

Here's what I have so far (I'm very bad):

RewriteCond /flv/(.*).flv !-f
RewriteRule ^ /flv/404.flv [L,R=301]

Thanks


You need two separate conditions. And you want to return a 404 response.

RewriteCond %{REQUEST_URI} ^/flv/.*\.flv$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* %{DOCUMENT_ROOT}/flv/404.flv [L,R=404]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜