Reputation: 4122
I am using Cloudflare and Digitalocean. I have setup my name servers and in Cloudflare I have these settings:
A: mydomain.com -> 1.2.3.4.5
CNAME: www -> mydomain.com
But when I visit my site by www.example.com I get redirected to:
So how can I keep the www part in my domain?
Upvotes: 0
Views: 263
Reputation: 325
You should go to page rules as below
There are two kind of redirect
Permanet redirect 301
Temporary redirect 302
Example
As you can see in below Picture all request to www.xxx.info will redirect to xxx.com
here * means all Paramter will accepted by cloudflare and put in place of $1 in redirect URL
Upvotes: 1
Reputation: 4399
The only way to insert HTTP redirects in Cloudflare is currently via Page Rules. If you don't have a redirect set in your Page Rules than this redirect must be on your Origin server.
As this is the case you will need to alter this in your application. For example, on WordPress you can do this in the admin dashboard (Settings > General, then changing the URLs there to include WWW).
Upvotes: 2