Reputation: 18771
I'm using firebase hosting to host my website and so far it's great with this small exception that I don't know how to fix:
If you go to mywebsite https://www.morningharwood.com my website works.
If you go to http://www.morningharwood.com my website work.
If you go to only morningharwood.com it works.
If you go to www.morningharwood.com it will work.
However, if you remove the www the website throws an error Your connection is not private
.
What is the proper implementation to afford the opportunity for any url combination to work e.g. http://morningharwood.com, https://morningharwood.com
My only solution is to add a redirect? but I don't htink this will work.
Upvotes: 3
Views: 6009
Reputation: 6926
As you have suggested, using a redirect to point all users of the base domain to the www
variant should work, and Firebase will automatically redirect HTTP traffic to HTTPS.
After creating a redirect in the console, it can take a while to propagate and will show status of pending
until it's ready. You can also redirect or rewrite Firebase Hosting traffic using the firebase.json
file.
It's really down to personal (or client) preference whether you keep or drop the www
but it's good practice to have one redirect or point to the other so that users who type either will reach the correct website.
The other option would be to setup your domain's DNS to redirect the base domain to www
using a CNAME record or similar.
Upvotes: 4