Professional website design firm Professional website design firm

 

 

Professional website design firm Professional website design firm

How to redirect Magento from Non www to www use .htaccess

Written by Administrator LAST UPDATED | 30 November 1999

Several times we have received above question from our customer in order that to day we will show you how to redirect your Magento site from a non-www, ex. http://yoursite.com to http://www.yoursite.com. There is a trick there.

  1. Enable Url rewriting (Admin Panel → System → Configuration → Web → Url Options → Use Web Server Rewrites → Yes).
  2. Now go to your .htaccess file on your Magento folder, (you might need to back up your .htaccess before making your changes.)

below the line # 123 code:

#RewriteBase /magento/

Add these codes, to make it:

#RewriteBase /magento/ 
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$ [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]

Replace yoursite.com with your own domain. Then, save your changes on your .htaccess

Joomla Templates and Joomla Extensions by ZooTemplate.Com

Add comment


JG Twitter Update

Developed by JoomVision.com

Client Testimonials

Quick Poll

How did you hear about us?

Google - 52%
Yahoo - 4%
Bing - 0%
Friends - 12%
Magazine - 0%
Other - 32%
The voting for this poll has ended on: 15 Jan 2012 - 00:00