# Jekyll-redirect-from questions

**URL:** <https://talk.jekyllrb.com/t/jekyll-redirect-from-questions/4572>\
**Category:** Help\
**Created:** [June 13, 2020, 3:27pm UTC](https://talk.jekyllrb.com/t/jekyll-redirect-from-questions/4572 "2020-06-13T15:27:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aisbergde](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/aisbergde/32/2589_2.png) [@aisbergde](https://talk.jekyllrb.com/u/aisbergde)\
**Post date:** [June 13, 2020, 3:27pm UTC](https://talk.jekyllrb.com/t/jekyll-redirect-from-questions/4572/1 "2020-06-13T15:27:38Z")

</div>

Hallo,

I want to migrate a blog from s9y, which is a php based blog, to jekyll

I used `beautiful-jekyll` to host an jekyll instance on github: [aisbergde.github.io](http://aisbergde.github.io)

I also found `jekyll-redirect-from` which should crete redirections, and it is in the list of plugins supported by github pages

I have read sometimes that github ignores the gemfile and nothing needs to be included, so I did not change it and it is still (whatever this means)

```auto
source "https://rubygems.org"

gemspec

```

I added one entry to the \_config.xml

```auto
plugins:
  - jekyll-paginate
  - jekyll-sitemap
  - jekyll-redirect-from

```

and I added something into the yaml front matter of one post file, like

```yaml
---
title: Warum ich seit 2017 den AnalyticsCreator verwende
subtitle: Und warum mich Wherscape nicht überzeugt hat
tags: [analyticscreator, dwh-automatisierung, etl, elt, dwh, wherescape, data-lineage, slow-changing-dimension, scd, ssas-tabular, ssas]
redirect_from:
  -/test/001.html
---

```

but nothing happens:

- no `test` folder is created in the repository (or will this be a virtual folder?)
- no redirection happens when I call:

> [aisbergde.github.io/test/001.html](http://aisbergde.github.io/test/001.html)

What’s my mistake?

if I get it work, **my finally goal would be to emulate a php call** :

`aisbergde.github.io/index.php?/archives/1-Warum-ich-seit-2017-den-AnalyticsCreator-verwende.html`

will this work at all?  
Maybe I can’t use the redirect method at all?

redirect\_from:  
-/index.php?/archives/1-Warum-ich-seit-2017-den-AnalyticsCreator-verwende.html  
-/test/001.html

---

<div class="post-metadata">

**Author:** ![ckruse](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/ckruse/32/16_2.png) [@ckruse](https://talk.jekyllrb.com/u/ckruse)\
**Post date:** [June 14, 2020, 3:52pm UTC](https://talk.jekyllrb.com/t/jekyll-redirect-from-questions/4572/2 "2020-06-14T15:52:10Z")

</div>

Hey @aisbergde - welcome to the community.

Couple of thoughts:

If you’re going to be using Github Pages as your host, I’d highly recommend using the `github-pages` gem as Github Pages only allows a select few plugins. Docs [here](https://jekyllrb.com/docs/github-pages/#the-github-pages-gem), but the short story is your `Gemfile` would be as follows:

```auto
source "https://rubygems.org"
gem "github-pages", group: :jekyll_plugins

```

Then, to use the `jekyll-redirect-from` plugin (which Github Pages allows), you’d add the following to your `config.yml`:

```auto
plugins:
  - jekyll-redirect-from

```

As for redirecting, I think you’ll be able to redirect from `index.php` but not `index.php?` using the `jekyll-redirect-from` plugin. So, I don’t think that plugin will solve your problem.

If nobody else chimes in with Jekyll-based solutions for redirects, I might recommend exploring solutions outside Jekyll e.g. [Netlify redirects](https://docs.netlify.com/routing/redirects/) and [Cloudflare Page Rules](https://support.cloudflare.com/hc/en-us/articles/200172286-Configuring-URL-forwarding-or-redirects-with-Cloudflare-Page-Rules).

Good luck!

---

<div class="post-metadata">

**Author:** ![aisbergde](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/aisbergde/32/2589_2.png) [@aisbergde](https://talk.jekyllrb.com/u/aisbergde)\
**Post date:** [June 14, 2020, 4:10pm UTC](https://talk.jekyllrb.com/t/jekyll-redirect-from-questions/4572/3 "2020-06-14T16:10:57Z")

</div>

thanks for your answer. I am a little bit confused regarding the gemfile and github: in some documentations I can read that gemfiles is ignored by github and the config.yml should be used. Or did I misunderstand this?

and regarding redirect the issue could be that I need index.php? and I can’t even create a permalink using this syntax.

---

<div class="post-metadata">

**Author:** ![ckruse](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/ckruse/32/16_2.png) [@ckruse](https://talk.jekyllrb.com/u/ckruse)\
**Post date:** [June 15, 2020, 12:05am UTC](https://talk.jekyllrb.com/t/jekyll-redirect-from-questions/4572/4 "2020-06-15T00:05:16Z")

</div>

Gemfiles are indeed ignored by Github Pages.

Adding a Gemfile with the `github-pages` gem ensures your local development environment matches exactly what Github Pages uses to deploy your site. It ensures you’re using the latest version of Jekyll that Github Pages supports and reduces the number of available Jekyll plugins to just those allowed by Github Pages among other things.

You still have to explicitly declare any plugins your project requires. Declaring the plugins via `_config.yml` is just one of three ways to go about declaring them. The other two are described [in the docs here](https://jekyllrb.com/docs/plugins/installation/).

Re: `index.php?`, yes, it’s the question mark `?` that’s causing the issue. Permalinks, redirects, and any other Jekyll-based solutions that I can think of won’t work.
