Repository navigation
Send the www of a custom domain on to the domain - #122
Merged
Merged
Conversation
A lambda answering at shop.example.com now sends visitors of www.shop.example.com there with a permanent redirect, path and query included, so search engines keep one address. A domain the owner entered with www is served at that name instead, and nothing is sent to it from the name without. A www that is another lambda's domain or one of the platform's own names is left alone. The editor lists the records for the www name beside the domain's, and the README issues the certificate for both names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A lambda with a domain of its own now sends visitors of
www.in front of it on to the domain:www.http-arena.com/page?x=1→https://http-arena.com/page?x=1, permanently, so search engines keep one address.LambdaRedirectConcern, beside the subdomain → domain redirect, ahead of everything else. A plain request goes straight to HTTPS on the domain. Moved Permanently for a read, Permanent Redirect for the rest, cached for a day.www.is served at that name, and nothing is sent to it from the name without.www.that is another lambda's domain, or one of the platform's own names, is left as it is.DomainRegistrybuilds thewww.names in the same reload as the domains, so a request does one more lookup in a frozen map.www.beside the domain's, with a line saying they are optional and what they do. The text is translated into all 13 languages.www.out where its DNS does not point at the server. CLAUDE.md records the decision.Certificates
A
www.name is only redirected once a browser trusts the server for it. A certificate already issued withoutwww.keeps working for the domain. Until it is reissued with both names, visitors of itswww.get the fallback certificate and a warning.reissue-www.shdoes this for every such certificate in/opt/genhttp-lambda/certs:www.whose DNS does not resolve to where its domain does, and names it;It does not restart the server, so the deploy of this PR picks them up. Run
--listor--dry-runfirst.Tests
New tests in
DomainTests:www.;www.that is another lambda's domain;The full suite passes (838), and
npm run buildpasses.🤖 Generated with Claude Code