Permanent Redirects to PHP Pages Not Working

Beachdog

Registered
Apr 3, 2007
2
0
151
We just did a conversion of a site to osCommerce, and we want to do redirects within cPanel to try and maintain SEO. When I try and do a redirect from http://www.domainname.com/oldpage.html to
Code:
http://www.domainname.com/product_info.php?products_id=220
cPanel tries to send me to
Code:
http://www.domainname/product_info.php%3fproducts_id=220
.

Why is the question mark being replaced with the %3f (I'm sure that it's the code for question mark, but still) and how do I make it NOT do that?

Thanks for the help, and sorry if this fix is published elsewhere. I did a search for redirect AND php and didn't see it.
 

david510

Well-Known Member
Aug 22, 2004
473
0
166
Add the following rule inside the .htaccess file under the public_html folder.

Code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} ^$ 
RewriteRule ^(oldpage\.html) /product_info.php?products_id=220 [R=301,L]
 

Beachdog

Registered
Apr 3, 2007
2
0
151
Thanks for the reply. After doing additional research I discovered that this was likely the direction that I'd have to go with it, instead of the cPanel route.