wigwambam Posted May 8, 2011 Share Posted May 8, 2011 Hi, What is the best way to change: www.mysite.com/product.php?id=1&sort=2&cat=z to: www.mysite.com/1/product-name-here I would need the other variables in the URL (sort & cat...) to also pass through to the new address. Is this an .htaccess change or via PHP code? Any help appreciated, thanks. Link to comment https://forums.phpfreaks.com/topic/235855-help-with-seo-friendly-urls/ Share on other sites More sharing options...
wildteen88 Posted May 8, 2011 Share Posted May 8, 2011 You will need to do two things. First change product.php so your links are in your new url format mysite.com/1/product-name-here Second use mod_rewrite to map site.com/1/product-name-here to product.php Link to comment https://forums.phpfreaks.com/topic/235855-help-with-seo-friendly-urls/#findComment-1212387 Share on other sites More sharing options...
floridaflatlander Posted May 8, 2011 Share Posted May 8, 2011 I need to learn about .htaccess but I got this to work like a charm http://www.desiquintans.com/cleanurls You'll need to do a little work on your product.php because you'll get this www.mysite.com/1/z instead of www.mysite.com/1/product-name-here Link to comment https://forums.phpfreaks.com/topic/235855-help-with-seo-friendly-urls/#findComment-1212395 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.