hi everyone, what’s the most appropriate way to redirect naked domain http://example.com|example.com to http://www.example.com|www.example.com?
depends on your web server, but in general:
- add A and optionally AAAA records to the apex domain (http://example.com|example.com) with your server’s IP(s)
- when you get an HTTP request to the apex domain, serve a 302 or 301 redirect to http://www.example.com|www.example.com with the same path and query params
for app engine specifically, the docs have the IPs to use. you’ll want to add http://example.com|example.com as a custom domain in the cloud console, and probably get an SSL cert for it too