1

How can I create my custom 404-not found page for a website I created through Repl.it? I know I would have to go to the .htaccess file if I were hosting it (or using a hosting service, maybe?), but what about through Repl.it? How can I create my custom 404-not found page using HTML, Javascript, and CSS?

Note: I already have the file written as a .html. I just need to be able to display it on an invalid URL...

Naveen Jain
  • 1,042
  • 7
  • 26

2 Answers2

1

I have gone through repl.it specs and for
now if you want to add custom error pages. You have to use python or next.js or any backend language .

And for server configuration using htaccess or nginx. Answer is already given by matthew above.

Naveen Jain
  • 1,042
  • 7
  • 26
0

I am not sure how Repl.it works but I can tell you how to redirect on 404 errors in Apache and Nginx webservers - if you have access to edit the respective config file.

In Apache, which I think you are using, in .htaccess add the following:

ErrorDocument 404 /your-404-page.html

for Nginx webserver, you'd need to find the config file which is usually found in nginx/sites-available/your-site.com and then add the following

error_page 404 /your-404-page.html;
Matthew Barbara
  • 3,792
  • 2
  • 21
  • 32