Skip to content

Fallback order imprecise #31288

@therealPaulPlay

Description

@therealPaulPlay

Example URL(s)

https://developers.cloudflare.com/pages/configuration/serving-pages/#single-page-application-spa-rendering

Actual Behavior

The docs state:

If your project does not include a top-level 404.html file, Pages assumes that you are deploying a single-page application. This includes frameworks like React, Vue, and Angular. Pages' default single-page application behavior matches all incoming paths to the root (/), allowing you to capture URLs like /about or /help and respond to them from within your SPA.

Expected Behavior

In my opinion, this is imprecise and can be confusing. It makes it sound like all incoming paths get matched to root, which doesn't happen. It's a fallback. if a request for /about comes in, and about.html exists, that file is served. The request does not get matched to /.

Potentially a clearer way to word this would be:
Pages' default single-page application behavior matches incoming paths that do not correspond to a static resource to the root (/), allowing your application to handle routes such as /about or /help client-side from within your SPA.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions