How to exclude certain file types from the following htaccess rewrite rule?

How can you exclude certain file 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] 
+4
source share
1 answer

What about:

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

Source: https://habr.com/ru/post/1345975/


All Articles