I wanted to ask you for your help. I found this answer that is recommended on the internet - Forward naked domain with URL path for my Google Domain but it seems that it is already outdated.
I tried a lot of things, I was using NakedSSL, wwwizard and I even transfered my domain from my local provider to google domains. No matter what I do, I am not able to set all 3 possibilites to nice 301 redirect (and one 200). This is my best result currently:
Structure | Redirect |
---|---|
https://example.com | 301 |
https://www.example.com | 200 (my preffered format) |
http://example.com | 301 |
http://www.example.com | 302 |
Here is my current setup:
- I added to DNS record
www | CNAME | my_server_address
- I added google forwarding from
example.com
tohttps://www.example.com
with301 | Forwarding Path | SSL On
The thing is, I have no idea how to force http://www.example.com
to also give me a 301. I am also not sure which entry controls this http://www
. I tried adding it second times to DNS, I tried adding it as the additional record in google forwarding but either the google domains system complains about structure and doesn't let me save it or it simply is not doing anything.
Could someone please point me in the right direction?
#EDIT:
My domain provider is now Google Domains
My hosting provider is PythonAnywhere (therefore I am given only CNAME (without A tag) and I don't have access to nginx). I am also using free SSL certificate and have option force HTTPS turned on.
http://www
using DNS entries. See this answer for a full explanation. What type of hosting and web server are you using for your site?HTTPS certificate: Auto-renewing Let's Encrypt certificate