Current Location: Home> Latest Articles> Complete Guide to Changing the Domain in PHPCMS

Complete Guide to Changing the Domain in PHPCMS

M66 2025-11-01

How to Change the Domain in PHPCMS

Changing the domain in PHPCMS involves several steps:

Backup Your Website

Before starting the domain change, make sure to back up all website files and the database to prevent any accidental data loss.

Modify the Database

Connect to your database and open the relevant PHPCMS tables, such as phpcms_config and phpcms_category. Search for all instances of the old domain and replace them with the new domain.

Update the Configuration File

Open the ./config/system.php file, locate the DOMAIN variable, and change it to your new domain.

Update System Templates

Open the templates in the ./templates/default/system directory and replace all URLs containing the old domain with the new domain.

Clear Cache

Visit ./index.php?m=admin&c=cache_all&a=init&sid=1 to clear the system cache.

Update Plugins

If you are using plugins, check their configuration files and ensure that the domain has been updated to the new one.

Check and Fix Errors

Visit your website and check for any errors or broken links. If any issues are found, return to the relevant step and make corrections.

Important Notes

  • Ensure that the new domain is properly pointed to your website server.
  • If using a CDN, update the CDN settings to reflect the new domain.
  • Set up 301 redirects from the old domain to the new domain to prevent visitors from encountering 404 errors.
  • Use SEO tools to check your website’s rankings and index status and make necessary updates.