Forum Moderators: phranque
I built a new site, but the browsers and other websites link to my product pages using a query string link with old filenames. I need to redirect the queries to use the new filenames.
How would I create this redirect?
Example
----------
Old Site:
[domain.com...]
New Site:
[domain.com...]
I've tried this:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^Product.aspx?SKU=([^/\.]+)/?$ /product_info.php?products_id=$1 [L]
and it doesn't seem to work. What am I doing wrong?
Thanks,
Rob
Use a RewriteCond with the %{QUERY_STRING} variable to test and/or back-reference query strings.
Note that the "?" serves only to delineate the URL from the query string, and will appear in neither the RewriteRule URL-path nor the %{QUERY_STRING} value.
See Note: Query String following the Apache mod_rewrite RewriteRule documentation [httpd.apache.org]
Jim