Does not work correctly on domains with www
Hi, we have a domain example.com where the cloudflare pages works correctly, and the web is displayed without any problem. However when we access by www.ejemplo.com sometimes loads and sometimes not, and often gives error nextjs application and does not open. The www are pointing with cname to cloudflare pages, and the same without the www. In cloudflare pages are configured both domains www.example.com and example.com What happens? Thanks
9 Replies
Have you added
www
as a Custom Domain here?
https://dash.cloudflare.com/<ACCOUNT_ID>/pages/view/<PAGES_PROJECT_NAME>/domains
yes, domain with www and without www
in dns settings have www redirect to cname @ , and without www redirect cname to pages cloudflare domain
What's the site? ejemplo.com looks like some parked domain
Yeah if you would be able to share the domain at all it would be greatly appreciated. Would be nice to take a look at the network requests.
hmm, I don't see any error that happens on the www subdomain but not the apex. I can see that with cache enabled, if I reload a few times quickly I see a client-side error for a second, but it happens on both www and the apex/example.com.
If it helps, you shouldn't have both the domain and the subdomain serving the same content, it's bad for SEO/duplicate content. It's recommended to redirect one to the other anyway:
https://developers.cloudflare.com/pages/how-to/www-redirect/
Hi, I have tried to follow these steps, but I see that in cloudflare they have changed the forms, so I can't follow it in the same way. can you help me? Thanks
Yo,
You have to add cloudflare internal ip and redirect in rules. You do that ?
your "main" url is with www or w/o ?
Just add A to www with : 192.0.2.1 (proxy on)
Create rules with URL : domain.com/*
Pick a setting (forwarding url /301)
Destination : https://www.domain.com/$1
my main url is without www
Ok so its ok