Cris
Cris

Reputation: 4044

htaccess - How to redirect old urls to new pretty ones?

I'm using opencart seo urls and they work fine. The problem is that I can access the old url too which results in duplicate content.

Example:

My new SEO Url is: http://site.com/blue-widgets

The problem is that I can access the old one too and I'm afraid to get penalized by the search enghines for having duplicate content: http://site.com/index.php?route=product/category&path=113

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

Upvotes: 0

Views: 991

Answers (1)

shadyyx
shadyyx

Reputation: 16055

I consider the problem of duplicate contents as kind of insufficiency within OpenCart.

But if You started to use only SEO URLs and if You are sure there is no old link to a concrete product that could be found and followed/indexed by robots You are safe.

Google (and others) could punish You if You were using both old and new URLs within You eshop (like the SEO ones dynamically generated and the old ones hardwritten somewhere within information pages...).

There is also other possible duplicit content problem - consider a product that is linked with more categories (if the product is linked to a third-level category it should also be linked to its second-level parent and also first-level parent) - then You can access this product from each category it is linked to and the URL will always be different (let's assume http://my.shop.com/televisions/3d-led-samsung is the very same product as http://my.shop.com/televisions/3d/3d-led-samsung and also as http://my.shop.com/televisions/3d/led/3d-led-samsung) - but here Google should not punish Your eshop as the name of the product 3d-led-samsung is always the same and Google should recognize it.

So I wouldn't be affraid of this.

EDIT: As Stann0rz pointed out, OpenCart automatically uses canonical links thus there is no reason to be affraid of Google penalizing You for duplicit content. Problem solved!

Upvotes: 2

Related Questions