Skip to content

Create 404.html error file with Jekyll #45586

Answered by jge162
salimbenfarhat asked this question in Pages
Discussion options

You must be logged in to vote

Hello @salimbenfarhat Here are some steps you can take to create the 404 error file.

a. create a new file in your Jekyll project called 404.html. This file should be located in the root directory of your project.

b. in this file, you can add your custom HTML code. You can also include Jekyll liquid tags to include dynamic content.

c. in your _config.yml file, add the following line: permalink: /404.html

d. this will ensure that Jekyll generates a 404.html file in your site's root directory.

e. commit the changes and push the code to your GitHub repository.

f. go to your GitHub Pages repository settings, and set the custom 404 page to your 404.html file.

then go ahead and load website to see.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@salimbenfarhat
Comment options

Answer selected by salimbenfarhat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pages Host a static website, right from your repo Question
2 participants