Forum Moderators: phranque
I have an ecommerce website which used to display products using dynamic urls.
So my blue widget product page was at
www.mysite.com/product_info.php?products_id=99
I recently change to use modrewrite to change the urls to be static
www.mysite.com/blue-widget-p-99.html
In my .htaccess file I have
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
which works very well but the rewrite works only on the p and the product number so,
I can see blue widgets even with the url
www.mysite.com/i-love-webmasterworld-p-99.html
This isn't a problem in itself but the text keywords are generated from the product keywords, so if I decide to start selling super blue widgets instead of standard I end up with
www.mysite.com/super-blue-widget-p-99.html
Now to Google this could look like duplicate content
www.mysite.com/blue-widget-p-99.html
and
www.mysite.com/super-blue-widget-p-99.html
so what I do is a 301 redirect in .htaccess from the old url to the new url
Redirect /blue-widget-p-99.html www.mysite.com/super-blue-widget-p-99.html [R=301]
I also update my text site map, xml site map and Froogle feed.
My first question is, do you think this is everything I need to do?
My second question is about the old urls, at the moment I have done nothing with them, because I don't think you can redirect dynamic urls in .htaccess, that's what you use rewrite for.
Am I safe to exclude
/product_info.php in robots.txt
I assume that the url rewrite totally hides the resulting url of
www.mysite.com/product_info.php?products_id=99
Thanks in advance,
Simon
Welcome to WebmasterWorld!
This recent post [webmasterworld.com] in our forum library addresses many of your questions, and would be a very good place to start. Several of the solutions and warnings presented apply directly to your situation.
Jim