Custom 404-Not Found Page
How can I include a custom 404 file in my website? I already have the .html
file written. Is there a .htaccess
file?
Vandesm14 (2643)
.htaccess will not work on repl.it as it requires an Apache server (i think). Try using a PHP server repl instead to see if the htaccess works or not. If that doesn't work, I suggest learning Nodejs Express. This is a super simple yet powerful web server framework built on Nodejs (it's javascript!).
Please mark this as answered if I helped your problem 👍
hey there,
Heres how i did it.
Things to know before u do this
1) Download your HTML repl as a zip and unzip it.
2) Make a new Node.js repl and upload the unzipped folder.
3) Rename that uploaded folder to
public
4) At this point, make sure
index.js
,404.html
andREADME.md
(if u have one) are in root. All other files should be in /public, including 404.js, 404.css, and index.html.5) Inside of
index.js
(The one in root. You should have 2 js indexes, one in /index.js and one in /public/index.js. The second one supports index.html, whereas the first one supports the server.) Enter this codethis should bring up your website.
Now we gotta keep the server alive
I used Cron Jobs
Once you login/signup, go to cronjobs. Make a new cron job. Enter your website domain in the first field. Unmark HTTP authentication. Set it to run every 1 minute. Save.
Voila!