How To Create A Custom 404 Page With A Custom Domain

I know that the question on how to make a custom 404 page has been answered, but I was wondering if it would be possible without backend if I have a custom domain connected?

It is not possible without a backend on replit with or without a custom domain.

1 Like

Hello @CosmixCom

To create a custom 404 page with a custom domain, you can use the following steps:

  1. Create a new HTML file with the desired content for your 404 page, for example “404.html” and place it in the root folder of your website.
<!DOCTYPE html>
<html>
  <head>
    <title>404 Error</title>
  </head>
  <body>
    <h1>404 Error</h1>
    <p>The page you are looking for does not exist.</p>
    <p>Please check the URL and try again.</p>
  </body>
</html>
  1. Update your website’s .htaccess file to redirect 404 errors to your custom 404 page.
ErrorDocument 404 /404.html
- On Apache servers, you can do this by adding the above line of code to the .htaccess file which is located in your root directory.
- Make sure that the path of your custom 404 page is correct.
  1. Test your custom 404 page to make sure it is working properly by trying to access a non-existing page on your website.

Note: If your website is hosted on a different type of server, the process for updating the .htaccess file may be different. You will need to check the documentation for your specific server. Also, you can also create a custom 404 page through your hosting provider’s control panel or website builder.

Also, make sure that you have the permission to update the .htaccess file and your server is configured to read the .htaccess file.

hope it helps! :slight_smile:

or try to create a custom 404 page with a custom domain, you will need to follow these steps:

  1. Create a new HTML file with the desired content for your 404 page.
  2. Upload the HTML file to the root directory of your website.
  3. Update your website’s .htaccess file to redirect 404 errors to your custom 404 page.
  • On Apache servers, you can do this by adding the following line of code to the .htaccess file: ErrorDocument 404 /404.html (assuming your custom 404 page is named “404.html”)
  1. If your website is hosted on a different type of server, the process for updating the .htaccess file may be different. You will need to check the documentation for your specific server.
  2. Test your custom 404 page to make sure it is working properly.

Note: You can also create a custom 404 page through your hosting provider’s control panel or website builder.

hope it helps @CosmixCom :slight_smile:

The thing is that replit .htaccess file isn’t public!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.