Skip to content

Commit 2ab4897

Browse files
authored
Update README.md
Added introduction, installation and example description.
1 parent 8484101 commit 2ab4897

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
# jekyll-redirect-html
22
A Jekyll layout that redirects to a new page.
3+
4+
For Jekyll sites, setting up URL re-writes or HTTP 301 Moved Permanently response codes on HTTP web servers (such as Apache or NGINX) is not possible. If you reorganise your site, external links to your original pages will be broken, which is not a great web experience.
5+
6+
The redirect layout created an HTML redirection page from the original page URL to its new location.
7+
8+
## Installation
9+
10+
1. Copy the `_layouts/redirect.html` file to your Jekyll `_layouts` folder.
11+
1. Optionally create a `_redirects` folder, adding it to the `include:` section of your `_config.yml`.
12+
1. Create a page with the front matter below. The redirect file name is not important as the original and redirect page URLs are controlled by `permalink` and `redirect` front matter settings.
13+
14+
## Redirect Page
15+
```yaml
16+
---
17+
layout: redirect
18+
permalink: /path/to/original/page/
19+
redirect: /path/to/correct/page/
20+
---
21+
```
22+

0 commit comments

Comments
 (0)