Changing your domain
This explains how to change the domain of a live site. Zittme supports multiple domains, so instead of editing configuration files, you add a domain and change the default in the admin screen.
Assume you are moving from from.com to to.com.
1. Prepare to connect the new domain
Point to.com to your server in DNS, and add to.com to your web server (nginx server_name or an Apache virtual host). If you use HTTPS, issue a certificate for the new domain as well.
2. Before the change: on the old domain
In the from.com admin screen:
- In System settings > Site settings, use "Add new domain" to add
to.com. Keep its settings the same as the existing domain. - Change the "Handling of unregistered domains" option to Show main page. (This is a safety net so visitors are not bounced during the switch)
- Set
to.comas the default domain. - Delete the
from.comdomain. (If you want visitors arriving at the old address to be sent to the new domain, keep it instead of deleting it. Visiting a domain that is not the default redirects to the default domain) - Restore the "Handling of unregistered domains" option to its original value.
- It keeps redirecting to the old domain: Try changing the
unregistered_domain_actionvalue todisplayinfiles/config/config.php. - Pages load resources from the old domain's address: Emptying
files/cachefixes this. - You do not need to edit URLs in configuration files such as
db.config.phpdirectly. Domain info is managed in the DB (the domains table).
3. After the change: on the new domain
Visit to.com and, in the admin screen:
If the domain already changed before you could prepare
If you cannot access the admin screen, change the domain directly in the DB. (If you installed with a different table prefix, change the rx_ part accordingly)
UPDATE rx_domains SET domain = 'to.com' WHERE domain = 'from.com';After running it, delete everything under the files/cache folder so the old domain info does not remain in the cache.