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 · 908 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 175 1 day ago
General · by lynbor, 5 days ago
2 113 2 days ago
General · by Old Man Umby, 1 week ago
1 97 1 week ago
General · by Sebastian, 1 week ago
1 120 1 week ago
General · by Andy Miller, 3 weeks ago
0 246 3 weeks ago