pandafy
pandafy

Reputation: 193

Redirecting multiple webpages on GitHub Pages

I read GitHub pages documentation for enabling redirects on GitHub Pages using the jekyll-redirect-from plugin. I was able to redirect from one page to another, but I have some different requirements. I need to redirect all pages from a starting url to another.

These URLs

should be redirected to

Upvotes: 2

Views: 518

Answers (1)

kalehmann
kalehmann

Reputation: 5041

As stated in the documentation for the plugin, you can add specify multiple urls for the redirect_from key.

For example create a index.md file with:

---
title: index
redirect_from:
  - /abc/def/
  - /abc/xyz/
---

## Hello, world!

and a _config.yml with:

title: Redirection test

markdown: kramdown
plugins:
  - jekyll-feed
  - jekyll-redirect-from

Now both /abc/def and /abc/xyz will redirect to your index page.

Upvotes: 2

Related Questions