Any nonexistent path off my domain resolves to homepage

All I have on my site is a single index.html file. When I type in, or /page2, etc. the same page loads. That is, shows the same html as as

I’m expected a 404 error when a nonexistent URL is typed in.

I have a CNAME record directing www to (proxied)
I have an A record with name @ and content (proxied)
I have a redirect rule to redirect the naked domain to www. I used:

When incoming requests match

Field: Hostname
Operator: equals


Type: Dynamic
Expression: concat("", http.request.uri.path)
Status code: 301
Preserve query string: :heavy_check_mark:

What’s wrong?

1 Like

In order to get a 404 on nonexistent pages, add a 404.html file at the top level of your site. Then that will be returned with a 404 response code.

The behavior you’re seeing is due to Pages defaulting to a single-page-app (SPA) behavior if you don’t provide a 404 page. See here for documentation.


Thank you.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.