Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to change the URL of your OpenCart store

This guide shows you how to change the web address of your OpenCart shop, for example when you move to a new domain.

Online Stores2 min read18 steps

What is the store URL?

A URL is the web address of your site, such as https://www.example.com. OpenCart saves this address in two settings files. If the address in those files is wrong, your shop may load without pictures, send you to the old site, or lock you out of admin.

Warning: a mistake here can break your shop. Take a backup of your files and your database first.

Before you start

  • Point your new domain to your hosting account. If the domain is new, ask Hostvento support how to add it.
  • Make sure your shop files are in the folder the new domain uses.
  • Decide if you want http or https. Use https if you have an SSL certificate.

Step 1: Edit config.php

  1. Log in to your hosting control panel.
  2. Open File Manager and go to your shop folder.
  3. Download config.php as a backup.
  4. Open config.php for editing.
  5. Find the lines that start with HTTP_SERVER, HTTPS_SERVER and sometimes HTTP_CATALOG.
  6. Change the old address to the new one. Keep the slash at the end.
  7. Save the file.
define('HTTP_SERVER', 'https://www.newdomain.com/');
define('HTTPS_SERVER', 'https://www.newdomain.com/');

These lines tell OpenCart its own address for the shop front.

Step 2: Edit the admin config.php

  1. Open the admin folder. If you renamed it, open the renamed one.
  2. Download config.php from there as a backup.
  3. Open it for editing.
  4. Change HTTP_SERVER, HTTP_CATALOG, HTTPS_SERVER and HTTPS_CATALOG. The admin address ends in /admin/.
  5. Save the file.
define('HTTP_SERVER', 'https://www.newdomain.com/admin/');
define('HTTP_CATALOG', 'https://www.newdomain.com/');
define('HTTPS_SERVER', 'https://www.newdomain.com/admin/');
define('HTTPS_CATALOG', 'https://www.newdomain.com/');

Step 3: Clear the cache

  1. Open the folder system/storage/cache.
  2. Delete the files inside. Do not delete the folder.
  3. If you use a cache extension, clear it from its settings.

Step 4: Test

  1. Visit the new address in your browser.
  2. Check pictures, menus and the checkout.
  3. Log in to https://www.newdomain.com/admin/.

If your shop still links to the old domain, the database may have old addresses in some content, such as descriptions. Fix those by editing the text in the admin panel.

Tip: If you set up https, also redirect old http links. Ask Hostvento support if you are not sure how.

Quick recap

  • Back up your files and database first.
  • Edit config.php in the main folder and in admin.
  • Clear the cache and test the shop and admin.
  • Fix old links in your content if any remain.