Apache ReWrite规则排除单个文件或文件类型?

时间:2009-12-31 05:11:37

标签: apache mod-rewrite rewrite

您能否帮助我使用Apache规则排除特定文件名或文件类型?以下是我目前的规则:

RewriteRule ^/(?:blog)/ - [L]
RewriteRule ^crossdomain\.xml$ - [L]  (Based on first response)
RewriteRule ^/(.*_css.*\.css.*) /$1 [QSA,L]
RewriteRule ^/(.*_js.*\.js.*) /$1 [QSA,L]
RewriteRule ^/(.*_swf.*\.swf.*) /$1 [QSA,L]
RewriteRule ^/(.*_img.*\.[jpg|JPG|jpeg|JPEG|gif|GIF|bmp|BMP|png|PNG].*) /$1 [QSA,L]
RewriteRule ^/(.*)$ /index.php?url=$1 [QSA,L]
</VirtualHost>

我试图排除我的Flash crossdomain.xml文件被重写。谢谢!

1 个答案:

答案 0 :(得分:5)

只需将此规则置于您的首位:

RewriteRule ^/crossdomain\.xml$ - [L]