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. 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.

Domain Hosting, Domain Name, Domain Guides, Domain Management

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.

Domain Hosting, Domain Name, Domain Guides, Domain Management

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.

0 comments:

Post a Comment

Facebook

Popular Posts

Blog Archive

Total Pageviews