In Magento, How to redirect all non www pages to www pages

In Magento this is how to redirect all non www pages to www pages using the .htaccess with an FTP client like FileZilla.

Open up .htaccess to edit the file then do a find in file and look for #RewriteBase.

#RewriteBase /magento/ under this line paste the following but remember to change www.youwebsite.com with your own URL.

RewriteCond %{HTTP_HOST} !^www.youwebsite.com$ [NC]

RewriteRule ^(.*)$ http://www.youwebsite.com/$1 [L,R=301]

After this we tend to run the following command via SSH:

php -f shell/indexer.php reindexall

That’s it, we always recommend backing up your files before making any changes.

If you need any help with Magento please contact us for pricing.

White Label Digital
Agency Manchester


Holt DevOps Ltd
The Barn, Woolden Road
Manchester
M44 5JX

White Label Digital
Agency London


Regisitered Addresss
71-75 Shelton Street
Covent Garden
London
WC2H 9JQ

Ready to work
with us?


hello@holtdevops.com


0161 676 8989

Stalk Us
On Social


We’re Hardcore Experts in Cutting-edge Technologies