Your shopping cart is empty. Browse our Store

Magento

Open Source eCommerce Evolved

Magento Forum

   
Implementing a 301 URL rewrite so all front-end URLs include “www”
 
NathanJ
Jr. Member
 
Total Posts:  26
Joined:  2008-04-07
 

Title says it all but…

This is good practice from an SEO standpoint. I don’t care about the backend URLs being standardized, but want to make sure that any crawlers or browsers are automatically sent to the “www” version of front end URLs, if they forget to type it or come in through a link that doesn’t include it.

I know I could just modify .htaccess to do this but I’m pretty lost when working with it, so I didn’t want to break any of the other SEF functionality.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
golles
Sr. Member
 
Total Posts:  179
Joined:  2008-01-15
 

this is how we do it: - place this in the .htaccess file (we have it at the top):

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domainname\.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.domainname.co.uk/$1 [R=301,L]

Obviously alter domainname to be you domain and change the .co.uk if you are on a .com domain

Hope this helps

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International) to request a call-back.
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
32116 users|337 users currently online|72012 forum posts