sladg / nextjs-lambda

Lambda deployments for Nextjs12 & Nextjs13 (standalone). Easy CLI commands to get your standalone Next output to run in AWS Lambda (not @Edge)! Uses CDK in behind and produces code zips importable to Terraform, Serverless, Azure, etc.
MIT License
169 stars 19 forks source link

Allow for use of `www` #71

Closed sladg closed 1 year ago

sladg commented 1 year ago

Generally speaking, using www has almost no down-sights compared to using root domain (apex), which has technical limitations such as CNAMEs.

After reading through RFCs on this topic, the preferred way is to have apex redirect to www and use www everywhere in case other subdomain is used.

Currently, it's not possible to easily follow this behaviour. You can specify www as subdomain, however, there is no mechanism to deal with redirection from apex out-of-box.

sladg commented 1 year ago

Implemented via --redirectFromApex. It will create HttpsRedirect from root (aka. from hosted zone) to provided address (dns prefix).