Reputation: 9901
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.
Upvotes: 0
Views: 570
Reputation: 1004
Here's another possibility:
RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:www\.)?mydomain\.com$ [NC]
RewriteRule ^(colors/.*)$ http://www.newdomain.org/$1 [NC,R=301,L]
Upvotes: 0
Reputation: 81052
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]
Upvotes: 1