Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

I need a redirect from www.example.com/blog/help/article

Started by Muut Archive 11 years ago · 3 replies · 299 views
11 years ago

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.

11 years ago

I have the same problem. Please, someone, help!

11 years ago

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.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1341 9 years ago
Archive · by Muut Archive, 9 years ago
2 928 9 years ago
Archive · by Muut Archive, 9 years ago
2 4057 9 years ago
Archive · by Muut Archive, 9 years ago
1 2942 9 years ago
Archive · by Muut Archive, 9 years ago
3 1115 9 years ago