Forum Moderators: phranque

Message Too Old, No Replies

URL rewriting creating duplicate content

         

cbx040

10:05 am on Apr 26, 2006 (gmt 0)

10+ Year Member



Hi everyone,

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

jdMorgan

2:29 pm on Apr 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

cbx040

9:07 am on Apr 27, 2006 (gmt 0)

10+ Year Member



Hi Jim,

Thank you for the welcome,
I did check the library first before posting my message.
Unfortunately I checked the wrong library and posted in the wrong forum.
But thank you for the link, it has helped me to understand the best way of doing this.

Simon