This guide will show how you can change URL for your Joomla website easily. This can be quite helpful when you are moving your Joomla installation from a subfolder, changing the main domain for your cPanel account or just thinking of using a different domain name for your site.
NOTE: Before proceeding with any changes, make sure that you generate a full backup of your website. If you've created your site using Softaculous script installer, feel free to refer to this guide as well (step #4 – Backup software).
Joomla CMS stores your website URL in configuration.php file located in the root folder of the domain in question. Follow these steps in order to make all the necessary changes:
1. Log into your cPanel > File Manager menu:
2. Navigate to the root folder of your Joomla installation, right-click on configuration.php and use Code Edit option:
3. Open the file and adjust its source code online. You will need to locate and edit the following line:
public $live_site = '';
4. Enter a new website URL in this line:
If your website uses SSL certificate, the URL should startwith https://domain.com and if it’s set via www, the URL would be http://www.domain.com.
5. In case the root folder of the installation was changed, you need to edit these lines as well:
public $log_path = '/home/user/public_html/joomla/administrator/logs';
public $tmp_path = '/home/user/public_html/joomla/tmp';
It means that the installation is located in /public_html/joomla subfolder.
6. Instead of the old path, enter the new one and hit Save button.
In our case, configuration.php file will look like this after the change:
Make sure that you actually move all the files to the new folder.
This completes the steps necessary to change the domain name for your Joomla website. However, remember that the changes for the database might be needed as well, it depends on how you configured your Joomla website.
In order to update the database, follow these steps:
1. Log into your cPanel > Backup menu:
Here you can download the backup of the database used for your site. You can look up the name of the database in configuration.php file we used earlier:
Download database file here:
2. Unzip the downloaded file. Now you can open .sql file with some text editor to update all the URL references.
Hit Ctrl + F and select Replace option. Fill out the corresponding fields, Find – your old domain, Replace – your new domain) and hit Replace All:
Make sure that you save the changes.
3. Now you can upload the updated database to your cPanel account. To be on the safe side, we suggest creating a new database (instead of dropping the existing one) and connect it to your Joomla site. To do so, move to Databases section > MySQL Databases menu:
4. Follow the steps below to create a new database and user for it:
Remember these details, you will need to use them a bit later.
5. After that you can upload the database using phpMyAdmin menu:
6. Select the newly created database from the list on the left and switch to Import tab. There you will need to use Browse option to pick up the database .sql file from your local device:
NOTE: If your database is more than 50Mb, import the database following the steps in this guide.
7. Once done, go back to File Manager and find configuration.php. Edit the following lines with the new database details:
public $user = 'USERNAME';
public $password = 'PASSWORD';
public $db = 'DATABASE_NAME';
Need any help? Contact our HelpDesk