opencart resolve www

If you just installed a fresh OpenCart shopping cart system to your host you probably noticed that your store address does not contain www symbols in it – for example url is instead of It may not be a big deal – your store will work just fine, but redirecting store to www does have some benefits – at least for search engines which love to see websites in that way. So how to solve it?

How to redirect OpenCart store to www url (OpenCart www)

You need 3 simple steps to make www appear in url:

  1. Enable .htaccess file in FTP. When you install OpenCart this file is in the root FTP folder (usually it’s public_html/), and it’s sort-of disabled – named as .htaccess.txt . You need to rename it – just remove the .txt part , so it will become .htaccess file and will be active then.

    opencart .htaccess file

    Enable OpenCart .htaccess file

  2. Open .htaccess file in text editor, and look for these lines:# SEO URL Settings
    RewriteEngine OnAfter the second line add another 2 lines of code:RewriteCond %{HTTP_HOST} !^www.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]Then save the file.

    .htaccess opencart

    Add www resolve code in OpenCart

  3. There are two config.php files in your OpenCart store – one in root directory (the same as .htaccess file), and another in admin/ folder. Open them both in text editor, and look for text in it. Just add www to them (as example and save files.

    opencart to www

    Just add www to config files.

That’s it – your store now will be redirected from to in every single page automatically.


Leave a comment

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

47 + = 56