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

How to make CS-Cart work with a new domain

This guide shows you how to change the domain name your CS-Cart shop uses.

Online Stores2 min read18 steps

What do you change?

A domain is your website name, like example.com. CS-Cart is software for running an online shop. It stores your domain in two places: a settings file and the admin panel. You must change both. If you do not, the shop may load without pictures or send customers to the old address.

Warning: take a backup of your files and database before you start. A mistake can make the shop unreachable.

Before you start

  • Point your new domain to your hosting account. Ask Hostvento support if you need help adding the domain.
  • Make sure the new domain opens the same folder as your shop files.
  • If you use SSL, install a certificate for the new domain. SSL encrypts the data between visitors and your site.

Step 1: Edit config.local.php

  1. Log in to your hosting control panel and open File Manager.
  2. Go to the folder where CS-Cart is installed.
  3. Download config.local.php as a backup.
  4. Open it for editing.
  5. Find the lines that set $config['http_host'] and $config['https_host'].
  6. Change them to the new domain. Do not add http:// or a trailing slash.
  7. Check http_path and https_path. Leave them empty if the shop is in the main folder. Use /foldername if it is in a sub-folder.
  8. Save the file.
$config['http_host'] = 'www.newdomain.com';
$config['https_host'] = 'www.newdomain.com';
$config['http_path'] = '';
$config['https_path'] = '';

These lines tell CS-Cart which domain and folder to use.

Step 2: Update the storefront settings

Newer CS-Cart versions keep domain settings for each storefront in the admin panel. Older versions use the Stores area. The menu names may differ.

  1. Open the admin panel on the new domain, for example https://www.newdomain.com/admin.php.
  2. Go to Administration, then Storefronts. In older versions go to Stores.
  3. Click your storefront to edit it.
  4. Update the URL or Storefront URL and the Secure URL to the new domain.
  5. Click Save.

If you cannot log in because the admin redirects to the old domain, fix the file first. If you still cannot get in, ask support for help with the database.

Step 3: Clear the cache

  1. In the admin panel, go to Administration, then Storage.
  2. Click Clear cache.

If you cannot open the admin, delete the contents of the var/cache folder in the File Manager. Do not delete the folder itself.

Step 4: Test

  1. Visit the new domain.
  2. Check images, menus, the cart and checkout.
  3. Test the admin login.
Tip: Set up a redirect from the old domain to the new one, so old links and search results still work.

Quick recap

  • Back up first.
  • Edit the host values in config.local.php.
  • Update the storefront URLs in the admin panel.
  • Clear the cache and test everything.