Change Joomla domain
Joomla – Changing the Domain
If you want to change the domain of your Joomla website, there are several important steps you need to follow to ensure a smooth transition. This process includes both switching to a new domain and updating the current settings.
Step 1: Backup Your Website
Before starting the domain change, it’s essential to create a full backup of your Joomla site. This ensures that you can restore everything in case anything goes wrong during the process.
Step 2: Changing Domain Settings
Adjust the Configuration File:
-
Use FTP to access the root directory of your Joomla installation and open the configuration.php file.
-
Look for the following line in the file:
public $live_site = '';
-
Insert your new domain into the empty field, like this:
public $live_site = 'https://www.new-domain.com';
Update the Database:
If there are URLs or media links still pointing to the old domain, you will need to update them in the database.
-
Open phpMyAdmin and run a search & replace query to update all instances of the old domain:
UPDATE `jos_content` SET `introtext` = REPLACE(`introtext`, 'https://www.old-domain.com', 'https://www.new-domain.com');
UPDATE `jos_content` SET `fulltext` = REPLACE(`fulltext`, 'https://www.old-domain.com', 'https://www.new-domain.com');
Step 3: Check SSL and SEO
-
Set Up an SSL Certificate:If you're using an SSL certificate for your new domain, make sure it is properly set up.
-
Check SEO Settings:Ensure that all internal links, redirects, and the sitemap point to the new domain. This is crucial to maintain your website's visibility in search engines.
Step 4: Clear Cache and Test the Site
After making the necessary changes, you should clear your website’s cache to ensure that no old data is being loaded:
-
Go to the Joomla backend, navigate to System → Clear Cache, and remove all cached files.
Test the Website:
-
Visit your new domain and check if all the pages are loading correctly. Ensure that no links or images are pointing to the old domain.
Step 5: Add Domain Alias and Change Main Domain
After making the changes in WordPress, you need to add the new domain as an alias in MyPanel and then set it as the main domain:
- Navigate:
- Log into MyPanel and go to Hosting → Settings.
- Choose Subscription:
- Select the hosting subscription where you want to modify the domain settings.
- Add Domain Alias:
- Click on the desired website and choose Domain Aliases. Click on Edit Aliases and add the new domain as an alias.
- Change Main Domain:
- After adding the domain alias, select the new domain in the Domain Aliases section and click Change Main Domain. The new domain will now be used as the main domain.
-
By following these steps, you can successfully add a domain alias and set it as the main domain in MyPanel.