views:

305

answers:

2

I want to use Helicon ISAPI Rewrite to redirect an old URL to a new URL, but only within a virtual directory named colors:

http://www.mydomain.com/colors/default.aspx?id=blue

needs to redirect to

http://www.newdomain.org/colors/default.aspx?id=blue

I am new to this and cannot find an appropriate example, so any help would be appreciated.

+1  A: 

Helicon ISAPI Rewrite appears to share mod_rewrite's syntax, so:

RewriteCond %{HTTP_HOST} www\.mydomain\.com
RewriteCond %{HTTP_URL} ^/colors
RewriteRule ^(.*)$ http://www.newdomain.org/$1 [R]
Jim Puls
A: 

Here's another possibility:

RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:www\.)?mydomain\.com$ [NC]
RewriteRule ^(colors/.*)$ http://www.newdomain.org/$1 [NC,R=301,L]
TonyCool