For SEO and usability purposes you may want to redirect your visitors to open your site only through www (http://www.yourdomain.com).To do this in Magento, you should open the .htaccess file in the folder where your Magento is installed. In it locate theRewriteEngine on line and right after it add the following lines:
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
Once you do this, save the .htaccess file and log in to the Magento admin area > System > Configuration menu and from the left panel click the Web button.Unfold the Unsecured set of options and 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!View more threads in the same category:
- Prevent an array filter warning while adding products
- Best Development Practices in Magento 2
- How to Secure Magento Against SQL Injections
- How To Backup And Rollback In Magento 2
- Implement Your Custom API In Magento Backend
- How to Create Simple Twitter Feed Module in Magento 2
- How To Secure cron.php In Magento 2
- How To Create & Configure Multi Store In Magento 2
- Create Your Own Widget In Magento
- Third Part of Magento Theme Development
Bookmarks