How do I redirect from a root domain to www for CloudFlare?

In order to redirect all of the requests for to, you should set the appropriate rewrite rule. This can be done by adding the following lines at the beginning of the .htaccess file in your public_html folder:

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

From now on, when someone accesses they will be redirected to

Using this method is safe because it should not create any redirection loops nor it should interfere with other rewrite rules. The only time we'd advise against this is if you've done lots of SEO work around getting links to your site as http:// then it might have an effect or you may want to consider signing up wiht ClouldFlare directly.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What is CloudFlare? How does it work?

CloudFlare is a system that acts a proxy between your visitors and your website, it accelerates...

Do I need to change my nameservers to use CloudFlare?

There are two ways of using CloudFlare, and it depends on which way you signed up.If you signed...

How do I get started with CloudFlare?

If after reading about CloudFlare you've already decided you'd like to use our...