jekyll / jekyll-redirect-from

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

Root-relative redirect URLs #193

Closed ptoews closed 5 years ago

ptoews commented 5 years ago

First of all, thank you for this great plugin. Sadly, we are having a problem with redirecting since the URL in the generated pseudo-files points to the absolute URL, including the site.url as prefix. On our website we decided to leave out the protocol prefix, so it's just our.domain.com without any https etc. (we don't want to enforce HTTPS because of certification issues). But it appears that since this URL neither starts with a protocol nor with a slash, it is interpreted as a relative URL, resulting in this URL being appended to the URL of the folder of the pseudo-file.

Here is an example: We want /en/news redirect to /news. We added a redirect_from: /en/news in /news.html. This generates a pseudo-file in /en/news that points to our.domain.com/news. Now, when we enter our.domain.com/en/news, we get redirected to our.domain.com/en/our.domain.com/news. How could we solve this?

I think one solution might be the possibility of choosing root-relative redirects, so that the pseudo-files would contain URLs like /en/news that are independent of the domain name etc.

DirtyF commented 5 years ago

site.url has to be an url. If you don't want to point to https, enter http://our.domain.com