Hey there So i'm trying to redirect get a site to redirect from www.domain.tld to domian.tld. I've got a CNAME record that looks like this: type: cname name: www.domain.tld. data: domain.tld. And i've set an L redirect in the Redirect section for the website. Visiting the url doesn't rewrite the address, but instead goes to different site on my server, and not the site i made the CNAME for. I hope that's an understandable description of my issue. Clearly this isn't how it's supposed to work, so how would I get this working properly? An help would be much appreciated.
Are you using ISPConfig despite posting in Linux forum? The makes me think you are using ISPConfig. Anyway, with ISPConfig there is Auto-subdomain: www. in the website settings. Turn it on. That CNAME looks OK. Is it working, that is if you use commands Code: host www.domain.tld host domain.tld host yourservername.thedomain.tld all return the same IP, which is your servers IP-number? If you have set up httpS on your websites, you may get redirected to wrong website if the certificate is not working correctly.
Yes, I'm using ISPConfig. Apologies for posting in here, i thought it had something to do with configs that aren't ISPConfig specific. Please move it to the appropriate forum, if possible. Ok, so i turned on the auto-subdomain, and it goes to the correct site, but causes an SSL_ERROR_BAD_CERT_DOMAIN, because the URL doesn't match the issued ceritificate. I'd like for it to re-direct/re-write to https://domain.tld, and not to https://www.domain.tld. Edit: and yes, all the host tests that you listed resolve to the same IP.
How was that certificate created? The LE Certs ISPConfig generates do include the subdomains you have defined for that website. You do not bother to mention what OS and what version of ISPConfig is used. There is a bug in some versions of certbot, a fix is in ISPConfig GIT stable version.
Apologies for leaving out the details of my system. I'm using Debian 9 and ISPConfig 3.1 git-stable, and used LE to create the certificate.