Jekyll-redirect-from redirects to empty url

I’m trying to use jekyll-redirect-from. It seems simple enough.

I have a page with this front matter:

---
layout: page
title: Sonoma County Matsuri Festival Schedule
permalink: /schedule
redirect_from:
  - /entertainment-schedule/
  - /entertainment/
teaser: |
    This page will soon be updated with information about
    the 2020 Matsuri festival.

---

It generates the following page in entertainment/index.html. Because it is redirecting to an url which is an empty string, it does not work.

<!DOCTYPE html>
<html>
<head>
<link rel="canonical" href=""/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="0;url=" />
</head>
<body>
    <h1>Redirecting...</h1>
      If you are not redirected automatically, <a href="">click here</a>.
      <script>location=''</script>
</body>
</html>

I can’t figure out why the generated page does not have the correct page.redirect_to.

I want and expect the page to redirect to /schedule.

I thought maybe I had modified my jekyll template, GitHub - Phlow/feeling-responsive: »Feeling Responsive« is a free flexible theme for Jekyll built on Foundation framework. You can use it for your company site, as a portfolio or as a blog., in a way that interfered with jekyll-redirect-from. So I tried applying jekyll-redirect-from directly to the unmodified template. Same result.

I tried this with the vanilla netlify template GitHub - netlify-templates/jekyll-netlify-cms: A starter template for Jekyll and netlify CMS, and it works.

So, there is something in GitHub - Phlow/feeling-responsive: »Feeling Responsive« is a free flexible theme for Jekyll built on Foundation framework. You can use it for your company site, as a portfolio or as a blog. that is breaking jekyll-redirect-from

1 Like

I gave up on jekyll-redirect-from. Instead, I put the file netlify.toml into my repo root, as follows. All is well now. I would have preferred jekyll-redirect-from, because it seems nicer to keep the info about redirect in the page that is the target. You can see this live at http://sonomamatsuri.com/

[[redirects]]
  from = "/entertainment-schedule/"
  to = "/schedule"
  status = 301

[[redirects]]
  from = "/entertainment/"
  to = "/schedule"
  status = 301

[[redirects]]
  from = "/about-us/"
  to = "/about"
  status = 301

[[redirects]]
  from = "/exhibitor-2/"
  to = "/exhibitors"
  status = 301

[[redirects]]
  from = "/sonoma-county-matsuri-scholarship-fund/"
  to = "/scholarship"
  status = 301

[[redirects]]
  from = "/photos/"
  to = "/festival"
  status = 301

[[redirects]]
  from = "/wp-content/uploads/2019/04/Press-Release-Sonoma-County-Matsuri-2019-04-19.pdf"
  to = "/press"
  status = 301


# https://www.sonomamatsuri.com/author/admin/ 404
# https://www.sonomamatsuri.com/category/uncategorized/ 404

Hi, @bolaurent, the failure appears to be with this repo. Is that correct?

If so, please note that our support staff will not be able to troubleshoot issues with third-party code.

However, if this is an issue where the code works locally but not in the Netlify build system, we’re happy to troubleshoot those types of issues. (Which isn’t troubleshooting the code itself and is instead troubleshooting why it performs differently at Netlify - something which is Netlify specific.)

Yes, the failure is in that repo. And I do understand that netlify won’t troubleshoot that.

I’ve abandoned jekyll-redirect-from and instead using netlify.toml, which works fine.

I posted about jekyll-redirect-from in case other users have similar issues.

Ah, I see; I should not have posted this question in Support, because that implies I have an issue with Netlify.

Looking for help here with anything Netlify-related (as your question very much is), is totally encouraged! Luke was just trying to set expectations about what our staff can help debug and what we can’t, but others in the community are welcome to go into detail on any request. Further, the act of you posting about it will still likely help future Jekyll’ing Netlify customers, so thanks for sharing! You might also consider linking to the thread where you asked the jekyll-redirect-from team to leave a trail of breadcrumbs for $nextperson who sees this… :wink: