# You attempted to rewrite a 404 inside a static page, and this isn't allowed.

Deprecated

This error is from an older version of Astro and is no longer in use. If you are unable to upgrade your project to a more recent version, then you can consult [unmaintained snapshots of older documentation](/en/upgrade-astro/#older-docs-unmaintained) for assistance.

> **InvalidRewrite404**: Rewriting a 404 is only allowed inside on-demand pages.

## What went wrong?

[Section titled “What went wrong?”](#what-went-wrong)

The user tried to rewrite a 404 page inside a static page.