How do I make a 404 page with HTML?

Question: By default, the Replit 404 page says “Not found.” I was wondering if it was possible to write code that redirects you to a 404 page if the requested page does not exist.

Repl link:

<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width">
	<title>Wrong Page!</title>
	<link href="/style.css" rel="stylesheet" type="text/css" />
	<link rel="icon" type="image/x-icon"

		<nav id="nav-bar">
				<a href="/index.html">
					<img class="logo"
						height="60" alt="Code road logo">

				<a href="/index.html">
					<li id="home">Home</li>
				<a href="/courses.html">
					<li id="courses">Courses</li>
				<a href="/resources.html">
					<li id="resources">Resources</li>
	<h1 class="red">Oops!</h1>
	<h3>It appears that this Coderoad page you are looking for doesn't exist. Are you sure you have the right link?</h3>
	<h3>Try going <a href="/index.html">to the home page.</a></h3>

1 Like

Unfortunately no you can. Nothing in the docs and I tried making a 404.html file but to no eval.

You can request this feature by pressing the Share feedback button on the ? and then the button left navbar.

You might also want to look at tutorials like this Custom 404 Error Page in PHP : 5 Steps - Instructables as you would need to be running a server before you would be able to redirect to a 404 page anyway.

1 Like

You can try out this template which includes custom 404 pages.