How to make a error 404 page?

I’m making a glitch website and if you go to a wrong page on the site it just says not found. Is there a way to make a custom page for that?

think you mean 404, not 403

I’m using a glitch-hello-website. Is there any way to use it on that?

Not at the moment, sorry.

The best you can do with a static project is to use a service worker to create pseudo error pages.

I created a proof of concept demonstrating this last year. However, I never got around to writing comments on how it works, so you may need to read up on service workers, if you are not familiar with them.

Since it is build around a service worker, it has its limits. Most notably, the error pages will only work if a user has visited your site once before.

3 Likes

Neat trick, hadn’t thought of that… :slight_smile:

1 Like

How do I use it?

If you already use a service worker, you would need to implement the logic shown in the project into your own service worker. If you do not use one already, you can use the one in the project as a base, and then modify it as needed.

If you have never used a service worker before, I would recommend you to read the link I posted. That should give you a general idea of how they work.

If there is a particular part of the code you do not understand, feel free to ask.