tjespe
tjespe

Reputation: 702

Is it possible to use Cloudflare DNS to create a subdomain?

Let's say I have the domain example.com, can I then use the Cloudflare DNS tool to map static.example.com to example.com/static?

I tried adding a CNAME entry, but I couldn't use slashes in the target.

Upvotes: 1

Views: 1024

Answers (1)

William
William

Reputation: 997

You can certainly use Cloudflare to create a DNS entry for your subdomain. The problem is that you can only point a CNAME record to another domain, not a URL.

You should however be able to configure the redirection from your subdomain on your web server.

Update: Curiosity compelled me to have a go at setting up a Cloudflare Page Rule for forwarding a subdomain to a URL and it works well. This feature does exactly what you are looking for.

Remember to create a CNAME entry for the subdomain you want to redirect, pointing to your domain root, and make sure that it is orange-clouded so it is processed by Cloudflare. Also remember that the DNS change may take a while to propagate.

Upvotes: 1

Related Questions