Hi everyone, I'm trying to redirect to a 404 page from a plugin with this method
/forum/archive/how-to-trigger-a-404-error-from-within-a-plugin-t3198
but nothing is happening...... If you have a solution!
Thank you! Thank you!
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Hi everyone, I'm trying to redirect to a 404 page from a plugin with this method
/forum/archive/how-to-trigger-a-404-error-from-within-a-plugin-t3198
but nothing is happening...... If you have a solution!
Thank you! Thank you!
you need to declare your function in getSubscribedEvents() function
then
public function onPageNotFound(Event $event)
{
// do your stuff
}
you can check many plugins use that method
... welcome to Grav Community 😀
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 80 | 9 hours ago | ||
| 1 | 51 | 13 hours ago | ||
| 0 | 44 | 1 day ago | ||
| 6 | 346 | 5 days ago | ||
| 3 | 40 | 5 days ago |