Forum Moderators: coopster
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...]
Thanks,
Rob
Since you use php is it safe for me to assume you are also using apache?
If so, the the htaccess redirect permanent may be of help to you.
Sort example:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^oldlocation.htm$ [mydomain...] [R=permanent]
If you are unfamiliar with the htaccess and mod_rewrite, you can find many usufull info here [webmasterworld.com ]
How do I incorporate that query string into this? Would it be:
RewriteRule [domain.com...] [domain.com...] [R=permanent]
or
RewriteRule Product.aspx?SKU$ [domain.com...] [R=permanent]
RewriteRule ^product.aspx?SKU=([^/\.]+)/?$ product_info.php?products_id=$1 [L]
Again, I am not an expert in htaccess and this rule might not work at all, but the general idea still stands. Redirect any product.aspx page to product_info.php page and assign any SKU=? to product_id=?.
For a better understanding in htaccess, please consult the apache forum here in webmasterworld (this is where i learn the basics :-) )