How to set up a CS-Cart alias domain

An alias domain is an alternate name for another existing domain. An alias must be a registered domain name. For example, let’s say you use the domain name examplestore.com for your storefront, but you also own the domain name examplestore2.com. You want visitors to examplestore2.com to land at the same storefront used by examplestore.com. You can achieve this by setting up examplestore2.com as an alias domain.

Add the alias in cPanel

Before you can use an alias with your CS-Cart store, you’ll need to set up your alias in cPanel. Details about setting up aliases in your HostPapa cPanel are here. If you need help accessing your HostPapa cPanel, see How to access your cPanel.

Note:
In previous versions of cPanel, alias domains were called ‘Parked Domains’ and some documentation references parked domains instead of aliases. The functionality and steps are the same.

Update the CS-Cart configuration file

Once your alias domain is set up in cPanel, you’re ready to configure CS-Cart.

In cPanel, click File Manager.

In the directory tree, click the root directory of your CS-Cart installation. In the file list, locate config.local.php. Right-click config.local.php and select Edit.

In the confirmation dialog box, click Edit to open the file in the editor.

In the file, locate this text:

// Host and directory where cs-cart is installed on non-secure server
$config['http_host'] = 'www.your_domain.com';
$config['http_path'] = '/your_cscart_directory';

// Host and directory where cs-cart is installed on secure server
$config['https_host']= 'www.your_domain.com';
$config['https_path'] = '/your_cscart_directory';

Add two forward slashes (//) to the beginning of each line that doesn’t already start with two slashes.

These lines should now look like this:

// Host and directory where cs-cart is installed on non-secure server
// $config['http_host'] = 'www.your_domain.com';
// $config['http_path'] = '/your_cscart_directory';

// Host and directory where cs-cart is installed on secure server
// $config['https_host']= 'www.your_domain.com';
// $config['https_path'] = '/your_cscart_directory';

Adding slashes converts these lines from active code to comments. Converting code to comments is safer than deleting the lines because it’s much easier to undo the change if you make a mistake.

Below the lines of code that you converted to comments, add this code:

// Host and directory where cs-cart is installed on usual server
$config['http_host'] = $_SERVER['HTTP_HOST'];
$config['http_path'] = '/your_cscart_directory';

// Host and directory where cs-cart is installed on secure server
$config['https_host'] = $_SERVER['HTTPS_HOST'];
$config['https_path'] = '/your_cscart_directory';

Click Save Changes and then Close.

Note:
The $_SERVER[‘HTTP_HOST’] and $_SERVER[‘HTTPS_HOST’] variables must exist on your server.

If you have any questions or need help, contact HostPapa Support by opening a support ticket. Details about how to open a support ticket are here.

Was this article helpful?

  • Was this article helpful ?

  • yes   no

Related Articles

Leave A Comment?