Question

CNAME not redirecting!

I am using Ubuntu with Apache with CloudFlare for the HTTPS.

Right now I have subdomain.domain.com working.

www.subdomain.domain.com does not work.

Google returns error- uses an unsupported protocol.

I have a CNAME for www to redirect to subdomain.domain.com but I keep getting that error…

Thanks for any help.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

jarland
DigitalOcean Employee
DigitalOcean Employee badge
July 30, 2018
Accepted Answer

Hello friend!

It is important to note that a CNAME is not a redirect, but a DNS alias. To show the example:

An A record means: name = IP

A CNAME means: name = other name’s IP other name = IP

So a CNAME is basically a short way to reference another A record, while not having to change that DNS record if the other A record changes later. However, the server at the IP behind the A record that is referenced must still be prepared to accept requests for the title of the CNAME, or return the same content to any request made to the IP regardless of the name.

For example, let’s say you have a virtual host for domain.com that displays your blog. You also have a default virtual host that displays a landing page if the web server receives a request that is not for domain.com. Now you add a CNAME for sub.domain.com to domain.com. When someone visits sub.domain.com, they will get the landing page because you have no virtual host for sub.domain.com.

I hope that makes sense. It’s rather generic as I do not know much about your specific application / configuration.

Kind Regards, Jarland

Digital ocean ignores all CNAME posts from what I see. Only solution I’ve found is to switch to another cloud provider. Very frustrating.

Yes, Thank You.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel