且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-02-08 18:18:53

什么:

 的RewriteCond%{REQUEST_URI} \(XML | TXT)!$。
 

How can you exclude specific files types (xml and txt) from the following rewrite rule?

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

What about :

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