Changing URL of OpenCart sites or stores are relatively easy. Basically you need to replace the old OpenCart URL or domain with new OpenCart URL or domain, then make sure the directory settings are updated according to the changes you made to the OpenCart installation. In an earlier guide, we showed you how to properly change OpenCart URL or domain. You can refer to this guide if interested. Today, we will list some of the most frequently seen issues and troubleshooting tips about OpenCart URL change.
Changing OpenCart URL by editing only one configuration file
The OpenCart system or CMS has defined your store URL or domain in two configuration files (config.php) located in OpenCart root folder and the admin folder separately. That’s to say you have to change the both of the configuration files. If you edit OpenCart URL unproperly, you may get an error when visiting your OpenCart front pages like below.
Warning: require_once(/home/public_html/system/startup.php)
[function.require-once]: failed to open stream: No such file or directory in /home/public_html/index.php on line 19
Fatal error: require_once() [function.require]: Failed opening required '/home/public_html/system/startup.php' (include_path='.:/usr/local/lib/php') in /home/public_html/index.php on line 19
The backend or OpenCart admin panel may error out as well:
Warning: require_once(/home/public_html/system/startup.php)
[function.require-once]: failed to open stream: No such file or directory in /home/public_html/admin/index.php on line 17
Fatal error: require_once() [function.require]: Failed opening required '/home/public_html/system/startup.php' (include_path='.:/usr/local/lib/php') in /home/public_html/admin/index.php on line 17
Not update OpenCart directory settings in configuration
Your existing or old OpenCart URL will appear multiple times in both the configuration files. You need to replace them in the HTTP and HTTPS sections. If you changed OpenCart domain path or moved OpenCart installation to a different folder, you need to update the directory settings in the configuration files as well. See the DIR section in below code snippet.
// HTTP
define('HTTP_SERVER', 'http://www.betterhostreview.com/opencart/');
// HTTPS
define('HTTPS_SERVER', 'http://www.betterhostreview.com/opencart/');
// DIR
define('DIR_APPLICATION', '/home/public_html/opencart/catalog/');
define('DIR_SYSTEM', '/home/public_html/opencart/system/');
define('DIR_DATABASE', '/home/public_html/opencart/system/database/');
define('DIR_LANGUAGE', '/home/public_html/opencart/catalog/language/');
define('DIR_TEMPLATE', '/home/public_html/opencart/catalog/view/theme/');
define('DIR_CONFIG', '/home/public_html/opencart/system/config/');
define('DIR_IMAGE', '/home/public_html/opencart/image/');
define('DIR_CACHE', '/home/public_html/opencart/system/cache/');
define('DIR_DOWNLOAD', '/home/public_html/opencart/download/');
define('DIR_LOGS', '/home/public_html/opencart/system/logs/');
define('DIR_MODIFICATION', '/home/public_html/opencart/system/modification/');
Update OpenCart URLs for both HTTPS and HTTP in configuration
If you have installed SSL certificate you should change both of them to the secured OpenCart link starts with https, so all your visitors browse your OpenCart store through the secure links protected by SSL certificate. If you do not have a OpenCart hosting yet, you can get web hosting package with free SSL certificate here.
Are you looking for a reliable OpenCart ecommerce hosting? You should check out this best ecommerce hosting package for small business here.