Cloudflare Pages forbidden error

Hi,

I tried to prevent access to default sub domain provided by Cloudflare Pages when the project is created using Cloudflare access. It works fine but the custom domain added to the project also gives forbidden error.

I would like to prevent access to default sub domain provided by Cloudflare Pages so that the site will only be accessible by custom domain only

Any suggestions are highly appreciated

Hi there!

What steps did you try to do when it blocked both domains? Depending on how you did it, you could be able to specify a condition in which it only blocks the request if a specific hostname is set (in this case the subdomain you wanna block).

I have enabled access policies in pages project. By default the access policy for the pages project will be created for default pages domain at 4th level right.

I logged into teams, removed the wildcard at 4th level domain making it 3rd level domain and added rule to block it. Now when I try to access with custom domain added to project it gives 401 error. Remove that rule for default domain then again works normally.

@MoreHelp @TKlein how might I achieve it and Thanks for the help