Ask coding questions

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

Say you created a new repl called, bob.repl.co (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 bob.repl.co/hello.html 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 bob.repl.co/jeff.html instead of it taking you to this page:

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

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

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

bob2424 (5)

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

hayaodeh (149)

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 (551)

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

PYer (2310)

@TheDrone7 Can you give me an example?

TheDrone7 (551)

@PYer https://repl.it/@TheDrone7/Trendy, 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 (100)

@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 (551)

@Galamphin I believe you won't be able to achieve that if you stick to frontend, also, I believe that repl.it 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 (66)

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

Galamphin (100)

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

TheDrone7 (551)

@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.