Ad

Help With Htaccess Redirect Rewrite Rule

- 1 answer

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.

Ad

Answer

Here's another possibility:

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