Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

How to redirect to a 404 error from a plugin

Started by Jean 7 years ago · 1 replies · 910 views
7 years ago

you need to declare your function in getSubscribedEvents() function

then

TXT
public function onPageNotFound(Event $event)
{
// do your stuff

}

you can check many plugins use that method
... welcome to Grav Community 😀

Suggested topics

Topic Participants Replies Views Activity
General · by jeremycherfas, 1 week ago
4 180 2 days ago
General · by lynbor, 5 days ago
2 119 3 days ago
General · by Old Man Umby, 1 week ago
1 100 1 week ago
General · by Sebastian, 1 week ago
1 124 1 week ago
General · by Andy Miller, 3 weeks ago
0 248 3 weeks ago