3

I'm having no trouble displaying a 404 page when using {redirect="404"}, but is there any way to actually redirect to my 404 page? ie. changing the url to /404 ?

I've seen Ryan's blog post, but he uses PHP to do it. Should I just write a simple plugin to do that?

Update:
I've created a plugin for this behavior.
https://github.com/jazonv/fourofour

1 Answer 1

0

Sure. You just need to use the native redirect tag:

{redirect='site/404'}

That will redirect to the template_group/template specified. :)

3
  • Ah, thanks, but the headers on that page are '302 Found', not 404. Apr 9, 2013 at 13:23
  • Technically this answers my question though. Apr 9, 2013 at 14:16
  • Ah, interesting. Yes I guess it would never be a 404 if it redirects to a found page. You could always directly insert the header on the page: <?php $this->EE->output->set_header("HTTP/1.0 404 Not Found"); but I see you've already gone one better and wrapped this up into a handy plugin. :) Nicely done.
    – Ian Young
    Apr 9, 2013 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.