Styles not loading for 404 pages
If you manage a 404 page in the CMS and it doesn't display properly on your live site in certain cases, the cause is usually how its CSS files are referenced.
Links within Page assets are relative by default. For a 404 page specifically, that breaks: browsing to a non-existent page deep in the directory structure means the relative CSS links resolve against that depth and point at nothing.
To fix it:
- Edit the
404page in your CMS. It may not literally be named404, though that's the common practice. - Click the Configure tab.
- Check Override the current Site's asset link rewriting behavior for this asset.
- In the link rewriting options that appear, select Absolute.
- Submit the page.
- Publish the page.
The CSS resources now load regardless of the location the 404 page is requested from.