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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Specify redirects at Page level

Started by Daniele Dore 7 years ago · 3 replies · 1000 views
7 years ago

Hi,
is it possible to set one or more redirects (301) directly inside the YAML file that defines a page?
I've read the guide and I can do it at the Site level, but I would need to set it directly in the default.md file of the page and I do not understand if it can be done.

Thank you and congratulations on this fantastic CMS!

7 years ago

Hello daniele, I don't think it's possible that way. What you can do however is specifiy arbitrary redirects under config > site > redirects & routes. Does that help?

7 years ago
YAML
redirect: <url>

Unless you mean specifying the redirect type. That I'm not sure of.

7 years ago

Thank you for the very quick response.
Yes, I had already set some redirects in the site settings correctly, but because I am migrating from an existing static site, it would have been a bit more convenient to insert the redirect directly into .md file that represents the new destination page.
I thought that maybe it could be done but I had not yet discovered how!
Thanks anyway

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 52 9 hours ago
Support · by Anna, 3 days ago
2 59 11 hours ago
Support · by Justin Young, 12 hours ago
1 30 12 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago