jekyll / jekyll-redirect-from

:twisted_rightwards_arrows: Seamlessly specify multiple redirections URLs for your pages and posts.
MIT License
789 stars 116 forks source link

Redirect pages not working when deployed from Netlify #247

Closed jglovier closed 2 years ago

jglovier commented 2 years ago

The URLs just load a blank page rather than redirecting.

For example, based on the rules specified in the header for jglovier.github.io/_posts/2011-06-29-html5-rant.md I expect that the following URLs would redirect to https://joelglovier.com/writing/html5-rant

However, they do not.

I think I have everything configured correctly in the repository, but perhaps I'm missing something? I've had this setup for years and when I first installed it everything worked as expected. At that time I was hosting on GitHub Pages, so the only differences now are that I'm hosting on Netlify, and gem versions are now different for many gems (perhaps there is a recent conflict with later gem versions?).

ashmaroli commented 2 years ago

Your site has a custom redirect layout with snippet:

{% include head.html %}

which has:

  {% if page.external_url %}
  <!-- for jekyll generated page redirects -->

  <meta http-equiv="refresh" content="0;url={{ page.external_url }}" />
  {% endif %}

So, a page gets redirection meta injected only if data key external_url is defined, which is not a feature from this plugin.

jglovier commented 2 years ago

OOooo wow - thanks for taking the time to spelunk and discover that, @ashmaroli!!! :bow: I don't recall the exact context there, but I think I had set it up years ago for including articles in my blog index that were on other sites. I can probably just remove that now.

Thank youuuu!

ashmaroli commented 2 years ago

taking the time to spelunk..

Made me LOL on reading that.. :laughing: You're welcome! =)