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
JustinNoel
JustinNoel17mo ago
Have you added www as a Custom Domain here? https://dash.cloudflare.com/<ACCOUNT_ID>/pages/view/<PAGES_PROJECT_NAME>/domains
albertmgta
albertmgta17mo ago
yes, domain with www and without www in dns settings have www redirect to cname @ , and without www redirect cname to pages cloudflare domain
Chaika
Chaika17mo ago
What's the site? ejemplo.com looks like some parked domain
James
James17mo ago
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.
Chaika
Chaika17mo ago
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/
albertmgta
albertmgta17mo ago
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
Mumutii
Mumutii17mo ago
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
albertmgta
albertmgta17mo ago
my main url is without www
Mumutii
Mumutii17mo ago
Ok so its ok
Want results from more Discord servers?
Add your server