Freelance PHP Developer | Freelance PHP Programmer | PHP Freelance | Freelance Developer | PHP Freelancer | PHP Freelance Developers | PHP Developers | Freelance Developers | PHP Developer

[Magento] Redirect non WWW to WWW Urls

magento-ecommerce

Seach engine always consider www and non www url as different one. If your website is accessible via both than you might be face a duplicate content issue which is very shameless for your website. So for better SEO and usability purposes, you need to redirect all your non www urls to www urls. So search engine can able to crowl only www urls and you will not face a duplicate content issue any more. To accomplish this, you just need to put below lines in your .htaccess file.

RewriteCond %{HTTP_HOST} ^yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]

If you are using Magento, than you need to follow one more step in order to get this completed successfully. Follow the below steps.

1) Log in to the Magento admin panel
2) Go to System > Configuration menu
3) Click on Web from left navigation
4) Click on Unsecured set of options
5) Change the Base URL option from http://yourdomain.com to http://www.yourdomain.com
6) You are Done.

      
Tweet
You can leave a response, or trackback from your own site.
    PHP Freelance | Freelance Developer | PHP Developer | PHP Freelancer | Freelance Developers | PHP Developers
    Freelance PHP Developer