Skip to content

Change the site address ​

Purpose ​

Move the website to a new domain without leaving the app, documentation, search metadata or share cards on the old address. The current public address is https://playpets.gaerae.com/.

The address lives in one place, homepage in package.json. The site's base path, sitemap and share-card addresses follow from it. A repository test lists every other file that still names a different address.

Audience and assumptions ​

The maintainer, with admin rights on the repository and access to the domain's DNS. The update feed is independent of the website: installed apps read latest.json from GitHub releases.

Set up a subdomain ​

For a subdomain such as playpets.gaerae.com:

  1. Add a CNAME record at the DNS provider.
TypeNameValue
CNAMEplaypetsgaerae.github.io
  1. In repository Settings → Pages, set Custom domain to playpets.gaerae.com. Wait for GitHub Pages to approve the certificate, then enable Enforce HTTPS.

GitHub recommends verifying the parent domain in the account's Pages settings so another GitHub account cannot claim one of its subdomains. Follow the TXT-record instructions shown there if gaerae.com is not already verified.

Move to another address ​

  1. Change the canonical address. Keep the trailing slash.
bash
npm pkg set homepage=https://example.com/
  1. Let the repository test list every remaining old reference.
bash
node --test tests/website.test.mjs

Update the listed current documentation, package metadata and tests until it passes. Do not rewrite dated decisions; add a follow-up decision when one mentions an address that was correct at the time.

  1. Redraw the share cards and check the project.
bash
npm run og
npm test
npm run lint
npm run site:build
  1. Commit and push. The pages workflow deploys the site with the new base path.

  2. Update the custom domain in repository Settings → Pages, wait for its certificate, and enable Enforce HTTPS.

Verification ​

  • The English root and /ko/, /ja/, /zh-hans/ and /dev/ return successfully over HTTPS.
  • HTTP moves to HTTPS.
  • The former address moves to the new canonical address.
  • Canonical and language-alternate links, og:url, og:image and sitemap.xml use the new address.
  • Styles, scripts, images and internal links load from the new base path.

Troubleshooting ​

SymptomFix
Pages says DNS check unsuccessfulCheck the DNS value and wait for it to spread. If Cloudflare is in front, use DNS only until GitHub issues the certificate
Enforce HTTPS is unavailableWait for GitHub Pages to issue the certificate; this can take up to a day after the DNS check passes
Styles and scripts are missingThe build still used the old base path. Check homepage, rebuild and redeploy
Search or social previews show the old addressRebuild the share cards, deploy again and inspect canonical, Open Graph and sitemap output

Free and open source under the MIT license. Not affiliated with OpenAI; Codex is a trademark of OpenAI.