To do this in Magento, you should edit the .htaccess file which is in the magento root folder. Locate the RewriteEngine in htaccess file then insert the below lines after the RewriteEngine :
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]After this go to admin area > System > Configuration -> web.
Change the Base URL option from http://yourdomain.com to http://www.yourdomain.com.
Save the changes and your Magento will start working through www.yourdomain.com only!
No comments:
Post a Comment