opencart resolve www

How to add www resolve to OpenCart for better SEO

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 http://your.store instead of http://www.your.store. 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 http://your.store text in it. Just add www to them (as example http://www.your.store) and save files.

    opencart to www

    Just add www to config files.

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

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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

42 + = 52