Skip to content

Some rewrites shadow static files by default #705

@LynnKirby

Description

@LynnKirby

- Do you want to request a feature or report a bug?

Bug.

- What is the current behavior?

Rewrites shadow static files (i.e. serve the rewrite rule instead of the file) without the ! or force setting when rewriting to non-HTML files or to /404.html. For example:

/*    /style.css                              200
/*    /404.html                               200
/*    /.netlify/functions/my-function/:splat  200
/:id  /.netlify/functions/my-function?id=:id  200

- If the current behavior is a bug, please provide the steps to reproduce.

Add index.html and 404.html as static files. Set _redirects to:

/*  /404.html  200

Navigate to /index.html. 404.html will be displayed instead.

- What is the expected behavior?

Rewrites don't shadow unless forced. The rewrites and proxies documentation says:

By default, you can’t shadow a URL that actually exists within the site when using a splat or dynamic path segment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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