Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: forward 404 to server #21

Open
Swader opened this issue Aug 11, 2016 · 3 comments
Open

Feature request: forward 404 to server #21

Swader opened this issue Aug 11, 2016 · 3 comments

Comments

@Swader
Copy link

Swader commented Aug 11, 2016

I know the plugin is "required", but I'd like to be able to customize the 404 reaction - in a nutshell, I would like it to be able to let the server handle the 404, so that the server can redirect a nonexistent post to my old blog, which is on a different subdomain now. Can this be done easily?

@flaviocopes
Copy link
Contributor

You can set redirects so instead of having a 404 you get a 301 redirect to the subdomain, see https://learn.getgrav.org/basics/grav-configuration#site-configuration


redirects:
  '/testing': 'https://oldsite.com/testing'

@Swader
Copy link
Author

Swader commented Aug 22, 2016

Yeah, but I have hundreds of posts on the old system, and I don't have a list of their routes to manually define like that. I would also still need a 404 for actually non-existing posts, those that don't have an old counterpart.

@mahagr
Copy link
Member

mahagr commented Aug 23, 2016

Once server has given the request to PHP, there's no way from PHP to let the server to handle 404 anymore. You could maybe be able to make some proxy setup to do it, but it may be easier to create your own 404 plugin for Grav, which does what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants