Page rule is not working

My website, hosted on AWS S3, is responding on https://www.leogrinstein.com.

I added a page rule to forward the root domain to www, but it is not working. Why?

Hi @leongrin,

You don’t currently have a DNS record for the root domain.

My website is on AWS S3. That means that I don’t have an IP to create an A record. Therefore, the article you recommended does not solve my problem.

As per the article, if you only want a redirect, you do not need an IP to point the record to, but can use any accepted IP. We usually recommend 192.0.2.1.

You are absolutely right. Thank you for highlighting this. But I made this change, and the problem persists. leogrinstein.com is not working.

PS: When I create the A record with @, it automatically adds the name of my domain after it’s created.

I just added this last weird page rule below, and it solved the problem.

No problem, it does work for me now. @ is just shorthand for your domain, and it will display the full record in the dashboard. It may have been cached on your end, but this test confirms it is working with the redirect:

>>> http://leogrinstein.com

> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------
Status:	301 Moved Permanently
Code:	301
Date:	Tue, 23 Feb 2021 14:51:46 GMT
Connection:	close
Cache-Control:	max-age=3600
Expires:	Tue, 23 Feb 2021 15:51:46 GMT
Location:	https://www.leogrinstein.com/
cf-request-id:	0870f906450000ee2bf8064000000001
Report-To:	{"group":"cf-nel","endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=wMG8PB%2BarwpLt4dQsKaZ6SUK2JBHrTj2rJ1OVgo5aSkQA9ko2rm2rL964N8%2FZq2991zSI9Lur2YpaL9FwIB9aDw44YQLaV8Jt8SYwn4ILArV"}],"max_age":604800}
NEL:	{"max_age":604800,"report_to":"cf-nel"}
Server:	cloudflare
CF-RAY:	6261c45048ffee2b-CDG

It must just be coincidence that you added that rule as it started working for you. Always Online wouldn’t affect the redirect and that third rule would never activate anyway, due to page rule priority/ordering.

Yes, it was a coincidence. I deleted the rule and it continues to work.

If you work at Cloudflare, you should update this article => https://support.cloudflare.com/hc/en-us/articles/360037983412-Configuring-an-Amazon-Web-Services-static-site-to-use-Cloudflare

There is no need to create a second bucket on AWS for the root domain. It’s much more efficient to do what you suggested me to do. Thank you very much!

1 Like

Great. I don’t work for Cloudflare, but I can flag that to the documentation team and see what their thoughts are on it. No problem, glad I was able to help!

1 Like