..I would like to send my 404 Page without changing the called URI..
Use sendForward:
http://rtfm.modx.com/display/revolution20/modX.sendForward
You can specify the second property like
array('response_code' => 'HTTP/1.0 404 Not Found')
to give it a 404 error response or whatever you want to give it.
sendForward expects a resource ID. If you need to add more info to the page, simply use modX::setPlaceholder and call that (uncached) on your target page.
-
- 134 Posts
Thanks Mark.
I actually thought of sendForward already, but since there's this rather complex setup including a cUrl-call, i'm not quite sure it will work. But if it does it certainly is the easiest way.
@itWilllBeOK
When you sendForward the process for the current page halts, so just do what you need to do before that.. it shouldn't matter what you do.
-
- 134 Posts
Well, it mostly really doesn't seem to matter what i do. You got that right.
But this actually did work, was a bit tricky though. Just setting the header would have been much easier. But then if i just don't know how to do it, whatever works is always easiest.
Cheers.
@itWilllBeOK