如何从以下.htaccess重写规则中排除特定文件类型?

时间:2011-03-31 01:57:26

标签: .htaccess mod-rewrite file-type

如何从以下重写规则中排除特定文件类型(xml和txt)?

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://website.com/$1/ [QSA,L,R=301]

1 个答案:

答案 0 :(得分:13)

怎么样:

RewriteCond %{REQUEST_URI} !\.(xml|txt)$