Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 www.website1.com is redirected to www.website2.com 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:
- www.website1.com\Mar\healthcheck.html
- www.website1.com\Mar\servname.html

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 www.website1.com\Mar\* through.

Thanks

share|improve this question
add comment

1 Answer 1

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: http://www.isapirewrite.com/docs/#RewriteCond

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

share|improve this answer
add comment

Your Answer

 
discard

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