Portal Home > Knowledgebase > CloudFlare > CloudFlare is working on www.mysite.com, but not mysite.com without the www?

CloudFlare is working on www.mysite.com, but not mysite.com without the www?

CloudFlare can only accelerate and protect CNAMES. Since your root domain is an A record, we recommend that you forward your traffic to ‘www’ through your .htaccess file. If you do not forward the traffic, then any traffic to www.mydomain.com will be accelerated and protected by CloudFlare (and shown in the statistics) and any traffic to mydomain.com will not be served by CloudFlare.

Since we work through CNAMEs CloudFlare can not be enabled on the root domain (since it is an A record). So, if you want to protect traffic going to the root domain, then they will need to add a redirect in the .htaccess file to 'www'.

Below is a snippet of code that can be used in your accounts .htaccess file. This snippet of code will direct all traffic from mysite.com to www.mysite.com. Just replace the "mysite.com" and "http://www.mysite.com" with your own domain name.

RewriteEngine On
# Rewrite added for CloudflareInstall - mysite.com
# Wednesday 25th of August 2010 04:59:42 AM
RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]


 

Also Read

Powered by WHMCompleteSolution