Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Error page

Started by Muut Archive 11 years ago · 5 replies · 415 views
11 years ago

Hello again,

My custom error page is not taken into consideration. Whenever a page is not found, this appears: http://prntscr.com/8qeycm . I created my error.html.twig inside theme templates folder. It used to work. Is there anything inside settings that I need to modify?

Thanks for your help.

11 years ago

One more question....how can i redirect to a created page by route? $this->redirect('route')?

11 years ago

Check that the Error Plugin is installed and enabled

11 years ago

That one fixed, thanks. But is it possible to get redirected to a 404 page instead of dispatching the 404 template? I mean, instead of having faulty url to have something like www.example.com/404

11 years ago

If I'm correct, the Error plugin does not do this now. The URL stays the same. You can create your own version of the Error Plugin, add a /error404 page and add call

$this->grav->redirect($this->config->get('plugins.error.routes.404', '/error404'));

11 years ago

Thanks it worked:

public function onPageNotFound(Event $event)
{
$this->grav->redirect('/error');
on Error plugin, /error being the route of my error page

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1344 9 years ago
Archive · by Muut Archive, 9 years ago
2 930 9 years ago
Archive · by Muut Archive, 9 years ago
2 4058 9 years ago
Archive · by Muut Archive, 9 years ago
1 2943 9 years ago
Archive · by Muut Archive, 9 years ago
3 1116 9 years ago