Redirect "Page not found" to homepage

Hello everyone,

Very simple question : how can I manage to redirect any “Page not found” to the homepage?
For example calling my site with routes to a page not found. I’d like it to route to


I have something working by using the error plugin with a route set to ‘/’, sorry for the noise.

I’ve seen sites do this and I think it’s a really poor idea. Please think through carefully whether that’s what you want to do. Ask yourself why we have 404 errors and why most sites don’t do this even though it’s a pretty obvious idea.

But I’m glad you found a way if that’s what you really want to do (and thanks for following up) :slight_smile:


Yes it is a bad and temporary solution I agree.
My former site was with php extensions like

Routing them in Grav does not work so I have to route them in the htaccess…
I also have some problem because I have some other websites in subfolders, I am cleaning everything but it takes time!

Thanks for your comment.

Redirecting 404s also makes it difficult to track down broken links! So you’re also making it harder for your migration task. All the best with your task anyway :slight_smile: