Links without trailing forward slash redirected to wrong domain
Thank you for contributing to the Open WIN Community
I'm submitting a ...
Put an x in the appropriate square brackets
-
bug/error report (eg. 404) -
documentation (eg. typos, broken links) -
feature request (eg. add GitLab tutorial) -
question (eg. how does this work?)
Where is the issue?
https://open.win.ox.ac.uk/pages/open-science/community/Open-WIN-Community/docs/gitlab/ https://open.win.ox.ac.uk/pages/open-science/community/Open-WIN-Community/docs/gitlab/gitlab-tutorials/ (and most likely elsewhere)
What is the issue?
Any link without a trailing forward slash on the pages causes a redirect, but to the wrong domain: "https://pages.fmrib.ox.ac.uk" instead of "https://open.win.ox.ac.uk/". For example, on the Gitlab tutorials page, the links to the various tutorials are broken (although the ones in the table of contents at the bottom work fine).
The issue seems to occur for relative links to markdown documents. Jekyll is not automatically appending a forward slash to these links for whatever reason. You can also reproduce the issue by simply removing the trailing slash from any valid link. This presents a mangled version of the site, which fails to fetch any CSS/JS.
How do we solve the issue?
-
Change the gitlab pages configuration so that it recognises the custom domain, rather than redirecting to the default domain.
-
Alternatively, there might be some way to configure Jekyll so that it always appends a trailing slash to these URLs. Ideally, we would do both and stop the redirects.
In future, we might consider replacing relative links with Jekyll link tags, which will cause a build failure if a link is invalid.
Anything else?
This forum post might be relevant?
Fix the issue yourself?
I have been trying to find a solution but it's difficult to test as the issue doesn't occur on a local Jekyll server.