Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14611 reviews 1734 hosting providers

Questions & Answers

I want to redirect Magento to open with www

Jan 8, 2013 by darkshark
Hi ..
Just like the title indicates. I want to know how to redirect visitors to my site to open my site only with the ‘www’. Any help would be appreciated
Thanks and regards

1 Answer

0 votes
Jan 8, 2013 by expert
open your .htaccess file placed in the same folder  Magento is installed. Inside the .htaccess file locate the line containing  RewriteEngine on and right after that line add the following code:
RewriteCond %{HTTP_HOST} ^your-domain.com$ [NC]
RewriteRule ^(.*)$ http://www.your-domain.com/$1 [R=301,L]
Then save the .htaccess file, and log to your Magento admin area and go to  System -> Configuration menu and click the Web button from the left panel. Unfold the Unsecured options and edit the Base URL option from ‘http://your-domain.com’ to ‘http://www.your-domain.com’.
Finally save your changes.