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:

  1. Using FTP or File Manager, navigate to the root of your OpenCart installation, and locate a file titled config.php.
  2. Edit the config.php file, and locate the lines that look like this:

    // HTTP
    define('HTTP_SERVER', 'http://example.com/');

    // HTTPS
    define('HTTPS_SERVER', 'http://example.com/');

  3. Change the existing URL (I hilighted the part you need to update in red) to your new domain name, then save the modification.
  4. 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', 'http://example.com/admin/');
    define('HTTP_CATALOG', 'http://example.com/');

    // HTTPS
    define('HTTPS_SERVER', 'http://example.com/admin/');
    define('HTTPS_CATALOG', 'http://example.com/');

  5. 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!
You are viewing Section 1: Change OpenCart URL - How To
Section 2: Finding a theme for your OpenCart Site
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
2013-11-12 10:56 am
Thanks alot for this tutorial. It really helped me alot. Very graphic and useful
n/a Points
2014-11-26 7:05 pm

Thanks for this post. I think this is what I was looking for. Just another question.

I installed opencart on a subdomain sub.domain.co.uk and currently the nameservers for the sub.co.uk arent updated to point to sb.co.uk (so that I can build it)

The store URL in settings show as http://sub.domain.co.uk. When I finish building the site, if I modify the URL in config to sub.co.uk and update the nameservers, will the store be functioning ok ? or should I update NS and install OC after that ? A reply is much appreciated. Cheers.

:-)

Staff
17,886 Points
2014-11-26 8:14 pm
Hello Vibz,

Thanks for the question. As long as the config is pointing to the correct URL and the files and database are accessible, then there should be no problem with running your OpenCart installation. If you have any further questions or comments, please let us know.

Regards,
Arnel C.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

3 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!