The jekyll-redirect-from plugin is now enabled in this Jekyll site. It allows you to easily handle 301 redirects for broken URLs.
_config.ymlGemfileAdd old URLs to any post or page using the redirect_from front matter:
---
title: "My Post Title"
date: 2023-01-01
redirect_from:
- /old-url/
- /another-old-url/
- /yet-another-url/
---
Use redirect_to to send users from this page to another:
---
title: "Old Page"
redirect_to: /new-page/
---
Add redirects using one of these methods:
Option A: Add to target page front matter
---
title: "Correct Page Title"
redirect_from:
- /broken-url-1/
- /broken-url-2/
---
Option B: Create a redirect page in _pages/ directory
---
permalink: /broken-url/
redirect_to: /correct-page/
sitemap: false
---
Based on common Jekyll issues, check for these patterns:
/article/post-name → should redirect to → /article/post-name/
/2023/01/post-name/ → should redirect to → /article/category/2023/01/01/post-name/
/old-category/post-name/ → should redirect to → /new-category/post-name/
/old-post-title/ → should redirect to → /new-post-title/
/category/feed.xml → should redirect to → /feed.xml
---
title: "Power Apps Guide"
date: 2023-06-15
permalink: /article/powerplatform/2023/06/15/power-apps-guide/
redirect_from:
- /powerapps-guide/
- /2023/power-apps/
- /articles/power-apps-guide/
---
If you merged multiple posts into one:
---
title: "Complete Power Automate Guide"
redirect_from:
- /power-automate-basics/
- /power-automate-advanced/
- /power-automate-tips/
---
Create a page in _pages/redirects/:
---
permalink: /old-category/post-name/
redirect_to: /new-category/post-name/
sitemap: false
---
After adding redirects:
bundle exec jekyll build
Check the _site folder for generated redirect pages
bundle exec jekyll serve
# Visit http://localhost:4000/old-url/ and verify redirect
curl -I https://powerplatformtip.com/old-url/
# Should return: HTTP/1.1 301 Moved Permanently
# Location: https://powerplatformtip.com/new-url/
For the 42 × 404 errors, create a checklist:
redirect_from to target posts/pagesAfter implementing redirects: