I need a redirect from www.example.com/blog/help/article to I need a redirect from www.example.com/help/article. I have tried multiple things but with no success. Article is a subpage of help page and blog is the root of grav.
Archive
I have the same problem. Please, someone, help!
I'm a bit confused by the question to be honest. Your questions states you want to direct from both of those pages.
I'll assume you meant redirect from the first to the second page.
1) you can put a redirect header statement in the /blog/help/article markdown file that redirects to the help article.
TXT
redirect: /help/article
This will mean anyone pointing their browser to /blog/help/article will get redirected to /help/article
2) If you don't have a page already in the blog you can redirect from site.yaml:
TXT
redirects:
/blog/help/article: /help/article
You can also use a regex and make this more flexible so any /blog/help/* request goes to /help/*
TXT
redirects:
/blog/help/(.*): /help/$1
All this information is in the Docs btw on the "Learn" site.
Thank you, rhukster
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1341 | 9 years ago | ||
| 2 | 928 | 9 years ago | ||
| 2 | 4057 | 9 years ago | ||
| 1 | 2942 | 9 years ago | ||
| 3 | 1115 | 9 years ago |