Home
Support Forums

Apex domain not redirecting to sub domain (primary domain)

UPDATE: I managed to redirect http://playalinda.com to https://www.playalinda.com. The issue was the line Save a plain text file called _redirects in the netlify docs. After hours of sifting trough other posts I saw a reply that said change _redirects.txt to _redirects, which was partially the fix.

The remaining problem is that now my https://playalinda.com won’t redirect like the HTTP one. Any advise?

_redirects:

http://playalinda.com/* https://www.playalinda.com/:splat 301!
https://playalinda.com/* https://www.playalinda.com/:splat 301!

Netlify site name: playa-linda.netlify.app
Custom (sub) domain: www.playalinda.com

The problem
I have an externally registered custom subdomain from a third party with SSL. Netlify automatically adds the apex? domain which is playalinda.com (no SSL).

I would like for all traffic to http://playalinda.com or https://playalinda.com to redirect automatically to https://www.playalinda.com.

Currently, users who land on http / https://playalinda.com see the warning screen of the unsecured site, and only after clicking through they end up on https://www.playalinda.com.

I would like users to instantly get redirected to the secure domain instead of having them land on the unsecure domain first.

Can you guys point me in the right direction as to how I can solve this issue?

My domain settings:

HTTPS

You don’t need _redirects to handle these redirects. The problem is, your domain is missing a certificate for the apex one. So, you need to update the customer certificate that would support the apex domain. Instead, you could also switch to Let’s Encrypt certificate and these redirects would be automatically handled.

Thanks, I think that worked. Does the automatic redirect from apex to subdomain like I set up only work when using Let’s Enrcrypt?

No it works when using any valid SSL certificate. But as I said in my previous reply, that certificate did not cover your apex domain and thus the error.

Moreover, Netlify automatically redirects from the apex domain to the www subdomain (if it’s set as primary, which in your case was), but again, it was a problem with the certificate that was blocking it.