MAJOR help needed in redirecting ASP pages through htaccess

I am fairly new to redirects and I can do the basic 301 or canonical, but I am having an extremely hard time with .asp and I need you smart people to help me!!

The site I do SEO for has a ton of duplicate content and I am trying to fix that by redirecting URL’s to the appropriate pages. What is happening is that I have X number of URLs all going to the same page when they should be redirected elsewhere. The problem is that the query string that comes with these URLs is throwing me off and I don’t know how to get around them and have tried every way possible.

For example:

I need the form.asp link to go to the /customercare. I have tried many variations of this code to no avail:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=7 [NC]
RewriteRule ^form\.asp$ /customercare [R=301,L]

I know I’m doing something wrong, but i just can’t figure it out! Your help in this matter would be GREATLY appreciated!


There’s nothing technically wrong with your code (except that it lacks the redirection to a useful link, something which can be output by the server and the missing “-” in the mod_rewrite redirection [a typo?]) albeit the No Case flag is typically used on the {HTTP_HOST} variable.

Like another current thread, I suspect that the problem may have to do with your use of IIS rather than Apache. There are at least two pseudo-mod_rewrite versions from M$ which are vastly different (only one uses Apache’s mod_rewrite code to emulate mod_rewrite’s actions).