By siteograf on
Hi!
I try to redirect users (301 redirect)
from http://www.example.com/product.asp?productID=1
to http://www.example.com/newurl
To do this I wrote in .htaccess file:
RewriteRule ^product.asp?productID=1$ http://www.example.com/newurl [R=301,L]
But it doesn't have effect.
As I understand the problem is in ? char, because next rule work fine:
RewriteRule ^product.aspproductID=1$ http://www.example.com/newurl [R=301,L]
Does anyone can help me?
Comments
Try using \? instead
How about
Does this help?
There is plenty of regex / URL rewriting help available on the web. Just google for mod_rewrite or regex .
For instance check out:
http://www.regular-expressions.info/reference.html
OK, I found!
In this topic I found solution: http://drupal.org/node/38960
If you have next URL:
http://www.example.com/product.asp?productID=1 ? mark after some letters (not /)
You need to write next rules:
=========================
If you have next URL:
http://www.example.com/?productID=1 ? mark after /
You need to write next rules: