Please Login or Register

Portal Home > Knowledgebase > CloudFlare > How to use CloudFlare on root domain (without www)

How to use CloudFlare on root domain (without www)

Because CloudFlare works through CNAMEs, CloudFlare cannot be enabled on the root domain, which is an A record. If you would like to use CloudFlare to accelerate and protect traffic going to the root domain, you must add a redirect in the .htaccess file to 'www'.  The "root" domain would be instead of 

As a reference, here is one example:

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

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Powered by WHMCompleteSolution