Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ The deployment token comes from a local `cloudhal deploy` (`.cloudhal/deploy/sec

## Domains

`cloudhal.com` serves the site and `studio.cloudhal.com` serves Studio (`domains` in `cloudhal.json`; the deploy adds both as Workers custom domains, which turns the workers.dev addresses off). `www.cloudhal.com` should 301 to `https://cloudhal.com` through a Cloudflare Redirect Rule on the zone.
`cloudhal.com` serves the site and `studio.cloudhal.com` serves Studio (`domains` in `cloudhal.json`; the deploy adds both as Workers custom domains, which turns the workers.dev addresses off). `www.cloudhal.com` answers with a 301 to `https://cloudhal.com` (path and query kept): `domains.redirects` in `cloudhal.json`, set with `cloudhal domain set cloudhal.com --redirect www.cloudhal.com`, served by the site Worker as a custom domain. Adding a new redirect host needs a deploy with zone permissions (a local `cloudhal deploy`); the Workers Builds token only redeploys existing domains.
5 changes: 4 additions & 1 deletion cloudhal.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
},
"domains": {
"site": "cloudhal.com",
"studio": "studio.cloudhal.com"
"studio": "studio.cloudhal.com",
"redirects": [
"www.cloudhal.com"
]
}
}
8 changes: 7 additions & 1 deletion wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@
"CLOUDHAL_SITE_ID": "site_8DTHH9QRG8CAMYKHENBW",
"CLOUDHAL_ANALYTICS": "on",
"CLOUDHAL_ANALYTICS_DEFAULTS": "{\"enabled\":true,\"uniqueVisitors\":false,\"vitalsOneIn\":5}",
"CLOUDHAL_SITE_HOSTS": "cloudhal.com"
"CLOUDHAL_SITE_HOSTS": "cloudhal.com",
"CLOUDHAL_REDIRECT_HOSTS": "www.cloudhal.com",
"CLOUDHAL_REDIRECT_TO": "cloudhal.com"
},
"routes": [
{
"pattern": "cloudhal.com",
"custom_domain": true
},
{
"pattern": "www.cloudhal.com",
"custom_domain": true
}
],
"cache": {
Expand Down
Loading