user1051619
user1051619

Reputation: 1

.htaccess exclude directory

I'm having some trouble excluding a few of my directories from a rewrite rule.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(cultivsearchenginesitemap|RSS)($|/) - [L]
RewriteRule ^(.*)$ http://www.niklashjelm.se/$1/ [L,R=301]

I want to exclude the directories on the third line but they keep getting the trailing slash, have tried placing it before and after the last line. Any ideas?

Upvotes: 0

Views: 325

Answers (1)

TerryE
TerryE

Reputation: 10898

If you are saying that you don't want the redirect to www.niklashjelm.se to occur for these two directories then line 3 should be the cond (or some tweak to this):

RewriteCond $1 !^(cultivsearchenginesitemap|RSS)/?

Upvotes: 1

Related Questions