Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have IIS 6.0 and am using a ISAPI rewrite to do a special URL redirect.

Basically how this will function, anyone going to is redirected to which I have setup with the following lines:

RewriteCond %{HTTP:Host} ^website1\.com$
RewriteRule (.*) http\://www\.website2\.com [NC,R=301]

However, there are 2 URL's that I want exluded from the rewrite rule:

What would I add to my current config for it to allow people through to those two URL's? Ideally it would just allow anyone going to\Mar\* through.


share|improve this question
RewriteCond %{HTTP:Host} ^website1\.com$
RewriteCond %{REQUEST_URI} !/Mar/healthcheck.html
RewriteCond %{REQUEST_URI} !/Mar/servname.html
RewriteRule (.*) http\://www\.website2\.com [NC,R=301]

Something like that, the syntax is here:

The guide says you should probably not use the ^ and $ vars unless absolutely necessary in Cond statements..

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.