This is a tutorial on how to change your OpenCart URL. There are various reasons for changing your website’s URL, such as testing our website on your Temporary URL, or you may just want to use a different domain name for your site.
We will walk you through editing and updating 2 .php files in order to accomplish this.
Changing Your URL
- Using FTP or File Manager, navigate to the root of your OpenCart installation, and locate a file titled config.php.
- Edit the config.php file, and locate the lines that look like this:
// HTTP
define(‘HTTP_SERVER’, ‘https://example.com/’);// HTTPS
define(‘HTTPS_SERVER’, ‘https://example.com/’); - Change the existing URL (I hilighted the part you need to update in red) to your new domain name, then save the modification.
- Now, locate and edit the config.php file located in the: /admin folder. You will see several lines that look like this:
// HTTP
define(‘HTTP_SERVER’, ‘https://example.com/admin/’);
define(‘HTTP_CATALOG’, ‘https://example.com/’);// HTTPS
define(‘HTTPS_SERVER’, ‘https://example.com/admin/’);
define(‘HTTPS_CATALOG’, ‘https://example.com/’); - Update the existing URL (I hilighted the part you need to update in red) with your new one, then save what you have done. Your OpenCart URL has now been changed in the config.php files, and your site will function on the new address.
Congratulations, now you know how to change your URL in OpenCart by modifying the config.php files!