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.

General

How to redirect to a 404 error from a plugin

Started by Jean 7 years ago · 1 replies · 696 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 Jerry Hunt, 4 days ago
2 80 9 hours ago
General · by pamtbaau, 14 hours ago
1 51 13 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago