Change primary URL
Move a live site to a new primary domain, with a dry run first.
Before you start
- You can open the site in Managed Websites. Anyone who can open a site can change its primary URL.
- The site has a domain attached, maintenance mode is off and Hostnames has no unsaved changes.
- The new host's DNS points at the site, so its certificate can be issued: see Check and point DNS.
Change the primary URL
Open the dialog
Go to Managed Websites, choose the site, then Domains & HTTPS under Site settings. Under Change primary URL, choose Change primary URL….
Enter the new host and check it
Enter the New primary host and choose Check, which shows where the new host, its
wwwor bare twin and the old primary point today. Choose Next: dry run.Read the dry run
The dry run counts every stored address that would change and changes nothing. Read the report, then choose Next: confirm.
Confirm
Check the summary and What happens. Type the current primary domain, then choose Change primary URL to and the new host.
The site's stored addresses are rewritten and there is no undo. To go back, run the change again the other way.
Domains & HTTPS follows the change, which takes about a minute, and ends with The site now answers on the new host as its primary. The old primary keeps serving the site until then.
What changes
| Platform | What is rewritten |
|---|---|
| WordPress | The old address in the database, including serialised data. |
| Laravel | APP_URL in .env. There is no dry run. |
| Magento 2 | The Magento base URLs. |
| Shopware | The storefront domains and the shop address. |
- The old primary and its
wwwtwin stay as aliases that redirect to the new primary. - Files, SSH, SFTP, deployments and the email sending domain do not change.
- A dry run is valid for 15 minutes.
Automate this
Starts the change that a preview described.
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/url-change \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"confirm_domain": "harbourandfinch.example.com",
"new_primary": "harbourandfinch.example.net",
"preview_token": "pReViEw-ToKeN-0123456789abcdefghijklmnopqr",
"www": "bare"
}'Your assistant calls corestack_url_change_apply.
{
"name": "corestack_url_change_apply",
"arguments": {
"site_id": 4211,
"new_primary": "example.com",
"confirm_domain": "example.co.uk"
}
}