Jekyll permalink with no ending slash gives 404

Hi. I am trying to migrate from GitHub to GitLab but there is a problem with Pages. Some URLs that have permalink configured without ending slash give Error 404.

Here is an example identical repository uploaded to both GitLab and GitHub:


Respectively their pages generated:


https://noscript.github.io/permalink-test/foo

On GitLab it gives 404 Not found but opens properly on GitHub.

Here is foo.html content (note: no ending /):

---
permalink: /foo
---
bar

Running Jekyll 3 locally gives me the same result as on GitHub. So I guess the problem is somewhere on GitLab side.

Hm… I don’t think so. If you check this post, you’ll notice that Jekyll dropped the addition of automatic trailing slash to permalinks from the version 3.x on. I’m not sure if they changed it again.

Your .gitlab-ci.yml does not specify the Jekyll version you wanna use. To have exactly the same behaviour as in GitHub, you could use the same Jekyll version GitHub Pages does. Check it here: https://pages.github.com/versions/.

Change this line to gem install jekyll -v 3.2.1. I tested it, it worked:

website: https://marcia.gitlab.io/test-jekyll/
project (imported yours): https://gitlab.com/marcia/test-jekyll

Hope to have helped! Let me know how it goes. :slight_smile:

I was looking everywhere to pin specific Jekyll version, thank you for that. Unfortunately 3.2.1 has the same issue.

Actually your pages have the same issue, https://marcia.gitlab.io/test-jekyll/foo returns 404

At the end I might try Jekyll v2.

:disappointed: Sorry, I didn’t get it before.

If you add /foo/ instead of /foo as the page permalink, it is gonna work. :slight_smile:


https://marcia.gitlab.io/test-jekyll/foo/

Unfortunately it is not an option, since http://example.com/foo and http://example.com/foo/ are not equally substitutable URLs. It will break my project that depends on several fixed URLs for a very long time.

But there is good news. I managed to install Jekyll v2 and it works https://noscript.gitlab.io/permalink-test-jekyll2/foo

It seems the problem haven’t been fixed yet, I have the same problem.