Open dev2xl opened 5 months ago
Hi @dev2xl, the sst.aws.Nextjs
component aims to use AWS only services. And afaik using an S3 bucket + Cloudfront distribution to achieve the redirect is unfortunately the best setup on AWS.
I agree Page Rule makes more sense in ur case. I'd suggest not configure redirect
on the Nextjs
component. And use the Cloudflare provider to create the page rule.
Let me know if that makes sense.
@fwang Yes although can we create page rules from ion? This will help to rely only on ion to setup the infrastructure instead of manually creating the page rules on cloudflare.
For a NextJS website hosted in AWS, and with CloudFlare DNS, if we setup a redirect from www to root domain,
ion
will create another cloud front distribution to handle the redirect with the code301 Moved Permanently
.Why not do this at DNS level with a Page Rule for example in Cloudflare?
Why not use the code
308 Permanent Redirect
?301
will changePOST
toGET
.308
will not do this, I think is more appropriate.Good work thanks!