Ask coding questions

← Back to all posts
HTML, CSS, JS Error Pages
Galamphin (115)

Say you created a new repl called, (I know this wouldn't be possible, it's just an example), and in the repl you created multiple HTML files, eg. index.html, about.html, hello.html ect.

If you typed in it would take you to that page.
So, I was thinking it would be really cool if you could make your own customised error page, not just the one that pops up made by repl.

So if you typed in instead of it taking you to this page:

It takes you to a custom error page, designed by you!

Answered by PYer (4013) [earned 5 cycles]
View Answer
PYer (4013)

That would actually be really cool. The replit team should allow you to make your own, custom 404 pages.
Sharing on discord...

bob2424 (6)

That would be a really cool idea, I'd love that!

hayaodeh (199)

I think it would be cool to have your own custom error page. @PYer The best way for us to read your suggestions is to talk about it here in talk, because we can't be on Discord all the time, but on Repl talk we can check it more often, and have more people upvoting and discussing the suggestion :)

TheDrone7 (1890)

Although you can already do it if you make your own backend using node.js or python or any other backend language.

PYer (4013)

@TheDrone7 Can you give me an example?

TheDrone7 (1890)

@PYer, you can see there I have defined my own custom error page. I'm not quite sure how I would do that in python but pretty sure you can do that.

Galamphin (115)

@TheDrone7 that's really clever! I'm not very experienced with JS, so how would you implement that to a HTML,CSS,JS setup?

TheDrone7 (1890)

@Galamphin I believe you won't be able to achieve that if you stick to frontend, also, I believe that itself uses my technique for showing the error page. You can always easily get started with js here. And as for the backend version (or node.js) you can click here.

coderash (286)

@TheDrone7 , could you tell me the code for a JS error page?

Galamphin (115)

@TheDrone7 could you specify were in the code the error page code is?

TheDrone7 (1890)

@Galamphin it's inside the views directory, the layout page has the main layout and the error file had the content to be displayed on the error page.