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

Redirect "Page not found" to homepage

Solved by nix View solution

Started by nix 8 years ago · 4 replies · 736 views
8 years ago

Hello everyone,

Very simple question : how can I manage to redirect any "Page not found" to the homepage?
For example calling my site with http://nimon.org/index.php routes to a page not found. I'd like it to route to http://nimon.org.

Best,
Nicolas

8 years ago Solution

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

8 years ago

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) :)

👍 2
8 years ago

Yes it is a bad and temporary solution I agree.
My former site was with php extensions like http://nimon.org/radioscapes.php.

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.

8 years ago

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 :)

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 76 8 hours ago
General · by pamtbaau, 13 hours ago
1 47 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