jekyll / jekyll-redirect-from

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

Circular redirects when running github-pages site locally #172

Closed jpeg729 closed 6 years ago

jpeg729 commented 6 years ago

I have a github pages site with several pages at urls of the form /page/index.html so for each one of these I add redirect_from: /page.html because an earlier version of the site used urls of this form.

This works fine on the live version of the site, but when I test the site locally using bundle exec jekyll serve and I try to navigate to localhost:4000/page/ or to localhost:4000/page/index.html or to localhost:4000/page.html then I get a page that says "Redirecting... Click here if you are not redirected". The link on that page sends me to localhost:4000/page/which reloads the exact same page.

This worked fine when I checked a few weeks ago. Moreover the above problem appeared before I ran bundle update and is still affecting the local version of my site.

Any ideas?

benbalter commented 6 years ago

See https://github.com/jekyll/jekyll/pull/3452. This is an intended behavior locally, in that, /foo.html, /foo/index.html resolve to the same page. If you believe that behavior isn't properly implemented, I believe we'd need to fix this upstream in Jekyll itself.

jpeg729 commented 6 years ago

My problem is that it is impossible for me to verify locally that those pages will display properly when deployed.

If the intended local behaviour of jekyll is that /foo.html and /foo/index.html resolve to the same page, then maybe jekyll-redirect-from should avoid trying to redirect from one to the other when running locally. Or maybe I am completely missing some really easy workaround.

Any ideas?

benbalter commented 6 years ago

@parkr IIRC you were an advocate for this behavior when originally implemented... any thoughts?