jekyll/jekyll-redirect-from

Plugins ignores base_url and takes hostname instead

sergio-ns opened this issue · 1 comments

Hello,
I'm running jekyll off a docker container and would like to redirect to 404.html attempts to open folder /assets/
The plugins gets installed during the container creation process:

Successfully installed jekyll-redirect-from-0.16.0
1 gem installed

In 404.html I added:

---
permalink: /404.html
layout: default
redirect_from:
- /assets/
---

In _config.yml I have:

baseurl: "" # the subpath of your site, e.g. /blog
url: "http://mysite.mydomain.com" # the base hostname & protocol for your site, e.g. http://example.com

When jekyll-serve starts an index.html is actually created in folder /assets but the the redirect URL is not using the base_url settings, rather the host name:

  <link rel="canonical" href="http://127.0.0.1:4000/404.html">
  <script>location="http://127.0.0.1:4000/404.html"</script>
  <meta http-equiv="refresh" content="0; url=http://127.0.0.1:4000/404.html">

which obviously won't work.

I would expect that the redirect location were instead:
<link rel="canonical" href="http://mysite.mydomain.com/404.html">

What am I doing wrong?
Thanks
S.

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.