1. Home
  2. CloudFlare
  3. 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., ggexample.com) 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 www.ggexample.com will be accelerated and protected by Cloudflare (and reflected in the statistics) and any traffic to mysite.com will not be served by Cloudflare.

To implement a redirect to www using .htaccess:

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

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

Was this article helpful?

Comments

Leave a Comment

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