Redirect Magento from non-www to www
15 October 2009
650 views
2 Comments
If you want to redirect your Magento site from a non-www, ex. http://yoursite.com to http://www.yoursite.com. There is a trick there.
- Enable Url rewriting (Admin Panel → System → Configuration → Web → Url Options → Use Web Server Rewrites → Yes).
- 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










We are looking for designers who can make the best vBulletin forum theme including logo with great exceptional imagination skills and you can win Dell XPS M1530 Laptop and more.
Great tutorial! Work like charm! Thank you ^^
Leave your response!
More About The Site
Translation:
Archives
Categories
Links
Recent Entries
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.