Skip to content
← Back to Community
HTML, CSS, JS Error Pages
Profile icon
Galamphin

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:

This file cannot be displayed: https://storage.googleapis.com/replit/images/1552813924503_4bbb98669aebb1691a26917cf7b5883d.pn

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

Answered by PYer [earned 5 cycles]
View Answer
Voters
Profile icon
RustyBlades5
Profile icon
KadenBlox
Profile icon
Programmer03
Profile icon
sst3ly
Profile icon
angrydoge
Profile icon
realWumpus
Profile icon
coderash
Profile icon
XJ5M
Profile icon
HackermonDev
Profile icon
coder787878
Comments
hotnewtop
Profile icon
PYer

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

Profile icon
bob2424

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

Profile icon
Jalcon

@bob2424 I know right!?

Profile icon
Galamphin

@Jalcon It really would.

Profile icon
hayaodeh

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 :)

Profile icon
PYer

@hayaodeh Ok. Thanks

Profile icon
TheDrone7

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

Profile icon
PYer

@TheDrone7 Can you give me an example?

Profile icon
TheDrone7

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

Profile icon
Galamphin

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

Profile icon
TheDrone7

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

Profile icon
coderash

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

Profile icon
Galamphin

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

Profile icon
TheDrone7

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

Profile icon
Galamphin

@TheDrone7 Thanks!