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
- Log in to your hosting control panel and open File Manager.
- Go to the folder where CS-Cart is installed.
- Download
config.local.phpas a backup. - Open it for editing.
- Find the lines that set
$config['http_host']and$config['https_host']. - Change them to the new domain. Do not add
http://or a trailing slash. - Check
http_pathandhttps_path. Leave them empty if the shop is in the main folder. Use/foldernameif it is in a sub-folder. - 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.
- Open the admin panel on the new domain, for example
https://www.newdomain.com/admin.php. - Go to Administration, then Storefronts. In older versions go to Stores.
- Click your storefront to edit it.
- Update the URL or Storefront URL and the Secure URL to the new domain.
- 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
- In the admin panel, go to Administration, then Storage.
- 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
- Visit the new domain.
- Check images, menus, the cart and checkout.
- Test the admin login.
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.