Resources     Blog  

  1. Home
  2. Knowledge Base
  3. CloudFlare
  4. Can I enable Cloudflare on a wildcard (*) subdomain?

Can I enable Cloudflare on a wildcard (*) subdomain?

For security reasons, Cloudflare does not proxy traffic to a wildcard sub-domain. You must explicitly list the subdomain as a CNAME in your DNS records to be able to activate Cloudflare.

Can I enable Cloudflare on my root domain (e.g., that is an A record?

Cloudflare can only accelerate and protect CNAMEs, not A records (the root domain is typically an A record). If you want to accelerate and protect the traffic to your root domain using Cloudflare, you have to do so by adding a redirect to “www.” Then any traffic to will be accelerated and protected by Cloudflare (and reflected in the statistics) and any traffic to will not be served by Cloudflare.

To implement a redirect to www using .htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$$1 [R=301,L]

NOTE: replace “” in the above example with your actual domain name.

Was this article helpful?

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.