Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle 404's in GitHub Pages while using Jekyll

I've setup my site at GitHub using Jekyll framework. I've a problem with 404's. I added a 404.html and it is working well for some typos. But, since in Jekyll categories are rendered in a separate directories and when a user is trying to access the url like www.example.com/category/ it shows the GitHub's 404 instead of my custom 404.html and also I don't want to index the category so what can I do?

P.S: Added a index.html to each and every category is a good idea. But, while building it overwrites everything in Jekyll. Any tips about that?

like image 219
Gowtham Avatar asked Jan 07 '14 14:01

Gowtham


2 Answers

This is very late, but I just solved this problem myself and want to help anyone who sees this question later, so the answer is just to put the following snippet:

permalink: /404.html

in your 404 page's YAML frontmatter. This tells Jekyll to put the 404 page at that location, where it's automatically recognized as a 404 page.

like image 123
imareaver Avatar answered Sep 23 '22 19:09

imareaver


Is your site domain pointing at 108.162.199.32? Try pointing at 192.30.252.153, 192.30.252.154.

Hope this fixes your problem :-)

like image 44
Hossain Mohd Faysal Avatar answered Sep 22 '22 19:09

Hossain Mohd Faysal