InMotion Hosting Support Center

Sometimes it is necessary to change the domain name for a website in Joomla. When you are using Joomla this will involve making a change to a configuration file and possibly your database. The following article will take you through the steps for changing your Joomla website URL.

Modifying the Domain Name for Your Joomla Website

Modify the configuration .php file of your Joomla Installation

  1. Login to your cPanel and then go to the File Manager.
  2. Locate the installation files for your Joomla files. Search for the root folder of your Joomla installation, then open the CONFIGURATION.PHP file in one of the editing options of the File Manager.
  3. Look for the following setting:

    public $live_site='domain_name.com';

    The "domain_name.com" represents the current setting. Below the "new_domain.com" represents your new domain name. Replace the text of the current domain name with your new domain name.

    public $live_site='new_domain_name.com';

  4. Once you have completed the change, click on SAVE CHANGES in your editor.

Change the Database Settings of Your Joomla Installation

  1. Login to your cPanel.
  2. Scroll down to the DATABASES section and click on phpMyAdmin.
  3. Select your Joomla database and then click on EXPORT in the top menu after the database is selected. The exported format will be SQL (e.g. filename.sql)
  4. Save the resulting SQL file to your local hard drive.
  5. As insurance, please make a copy of the SQL file and save in another folder or location. Basically, you're making a backup of your SQL file. You can also re-export the database and simply select a different file name, or different location.
  6. Open the exported SQL file that you wish to edit in a TEXT EDITOR (e.g. Notepad.)
  7. Find and Replace all of your old URLs with the new one. Note: the default keyboard shortcut for "find and replace" is CTRL+H (hold down your control key and click on 'H') - this will bring up the Find and Replace dialog.
  8. Once you have replaced all of the old URLs with your domain name save the SQL file.
  9. Next, in order to replace the old entries in your database, you will need to remove them before you can bring in the changes. In phpMyAdmin, click on the Structure tab in order to see all of your tables.
  10. Scroll to the bottom of your table list and then click on the box labeled Check all.
  11. Next, click on the drop-down arrow to the right where it is says "With selected:". In the drop-down menu, select Drop under the section labeled Delete Data or table. It will proceed to execute dropping all of the tables, but will give you one last "Yes or No" to complete the process. Click on Yes to complete the drops. Note, we are not deleting the overall database, just the tables. Don't worry, as you are about re-populate it with the updated table. Also, remember that you should have a backup of the database in the event that something happens to interrupt the process.
  12. Once all of the tables are gone, you can then go forward with importing the updated table. Go back to phpMyAdmin and then IMPORT your updated SQL file back into the SAME Joomla database.

This completes the steps necessary to change the domain name for your Joomla website. Remember that the changes for the database might not be necessary as it depends on how you configured your Joomla website. If you require further information on Joomla, please go to the Getting Started Guide: Joomla.

Was this article helpful?
You are viewing Section 2: Changing the URL of a Joomla Website
Section 1: How to Create a Sitemap in Joomla 3
Section 3: How to change your Site Name in Joomla 3.1

Joomla Community Google+ Hangout #3

June 3rd, 2014

Thank you @RustyJoomla for letting me speak on the Joomla Community Google+ Hangout!

Click here to watch!

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

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

n/a Points
2017-10-02 9:57 am

I am in the process of transferring my website irhal.com to a new server. Before I make the final switch of pointing the domain to the new server I want to test that the new server is working fine.

So I copied everything to the new server and accessed it with the IP address or another domain which I have pointed to the new server (irhal.org). The first page comes up fine but the links on the page go to a 404 error.

I do not want to change the Joomla settings to irhal.org as I will later point irhal.com to the new server. What do i need to do to test that the links work and not just the main page. PS: I am not very tech savvy.

Staff
42,232 Points
2017-10-02 10:41 am
Hello,

The problem is that a Joomla website requires the URL that you're using in the database. If you want to test the new server you should either test a different Joomla installation OR, set up a HOSTS file modification. The HOSTS file modification is what developer typically use when moving from one location to another. It lets you use a domain name that may still be pointing elsewhere. The HOSTS file modification only applies to the computer where you make the modification. It requires that you know IP address of the server that you want to view. Please refer to the link I have provided for a tutorial on how to make the HOSTS file change.

I hope this helps to answer your question, please let us know if you require any further assistance.

Regards,
Arnel C.
n/a Points
2017-08-17 10:00 pm

Hi, I want to change the primary domain from my joomla website. Do I just follow these steps or do I also have to change the main domain in my cPanel account? as it says in the other article below. I only have one website on the cPanel account.

http://www.inmotionhosting.com/support/domain-names/general-information/how-do-i-change-the-main-domain-name-on-my-account

Staff
10,724 Points
2017-08-18 10:58 am
Instead of the changing the primary domain, it would be easier to use an addon domain.
n/a Points
2015-03-03 6:03 pm

I follow your steps and now our project has several 1064 errors. The databases is not working fine now

 

Our project is damage now.

 

: (

Staff
10,077 Points
2015-03-03 6:12 pm
Hello Johan,

What changes have you made exactly? Have you tried reverting the changes?

Best Regards,
TJ Edens
n/a Points
2015-03-06 6:34 am

A lot of the time the first error is causing the rest of the thousand errors. What is the first error?

n/a Points
2015-02-12 7:10 pm

Thanks, this is what I needed. Two points of caution though:

  1. If you export your database you shouldn't use Notepad as it doesn't handle double byte characters like Chinese properly and will corrupt everything when you re-import it. Personally I use Notepad++ for this type of task.
  2. If you still value the old domain then make sure right after this you search for a tutorial explaining how to 301 redirect the old domain to the new one or you wont transfer your Google ranking. Make sure that it forwards the subpages and the non-www domain as well as the homepage.

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.

8 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!