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

Ability to run from 0.0.0.0 and have IP magically converted? #188

Closed patrickhlauke closed 5 years ago

patrickhlauke commented 5 years ago

I'll preface this by saying that I'm not 100% sure if this is something that can/should be done at this plugin's level or not. If I'm way off base here feel free to just close it.

Context is https://github.com/twbs/bootstrap/pull/27552 - we're using a Jekyll host value of 0.0.0.0 to allow for access on the same local network when running documentation locally (see https://zarino.co.uk/post/jekyll-local-network/). However, this apparently conflicts with redirects, as the redirects then get rewritten with the 0.0.0.0 url, which doesn't actually work / is magic in that it translates to 127.0.0.1 and localhost

So currently, there's a bit of a conundrum - changing the _config.yml to have host: "localhost" solves the redirect issue, but breaks the local network access, and host: 0.0.0.0 breaks the redirects but allows local network access. Is there any way / would it make sense for the redirect plugin here to special-case the magic 0.0.0.0 value and internally treat it as / substitute it with localhost?

DirtyF commented 5 years ago

/cc @jekyll/build

parkr commented 5 years ago

This gem uses Document#url to determine the URL to which to redirect.

Are you speaking generally of both redirect_from and redirect_to pages?

patrickhlauke commented 5 years ago

@XhmikosR do you mind filling in info on the types of redirects that cause issues?

XhmikosR commented 5 years ago

Any redirect has this behavior.

XhmikosR commented 5 years ago

Anyway I don't see it as an issue. It's poor config IMO.

trigger-segfault commented 5 years ago

I second the need for this fix. I use 0.0.0.0 to test on different devices and I have to edit the config and restart to test redirects, then and edit the config restart again to go back to testing on mobile.

Forgive me as at I'm not too savvy when it comes to networking, but wouldn't the best option be to replace 0.0.0.0 with the local IP address upon generation?

DirtyF commented 5 years ago

@trigger-death You can use multiple config files with --config CONFIG_FILE[,CONFIG_FILE2,...]

jekyllbot commented 5 years ago

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.