Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

How to redirect to a 404 error from a plugin

Started by Jean 7 years ago · 1 replies · 959 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 Andy Miller, 6 days ago
0 108 6 days ago
General · by lynbor, 1 month ago
3 437 2 weeks ago
General · by lynbor, 3 weeks ago
7 557 2 weeks ago
General · by Harry, 2 weeks ago
0 159 2 weeks ago
General · by Old Man Umby, 1 month ago
2 308 3 weeks ago