Link to home
Create AccountLog in
Avatar of mugsinc
mugsincFlag for Sri Lanka

asked on

how to redirect non www to www at domain level

how can i redirect a non www to a www at domain level with cname, the domain is hosted at godaddy. this is due to the ssl certificate on the site and the site is on coldfusion
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image


You don't.

It may be that GoDaddy offer it as a service, I can't say about that. However, CNAME records cannot redirect, nothing in DNS will help here.

You need another web-server or web-site to redirect you to the correct name before you get as far as securing the connection. Of course, if they're typing in "https://domain.com" there's not a whole lot you can do other than wildcard SSL certificates or certificates with a populated SAN field.

Chris
ASKER CERTIFIED SOLUTION
Avatar of Onlyodin
Onlyodin

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Put this in the <head> section of your HTML page.
<script>
if(window.location.protocol=="http:"){
  window.location="https:"+window.location.href.substr(6);
}
</script>

Open in new window