1

In my Templates Global Preferences I've set the 404 page to go to pages/404.html template. In that template is a redirect to the 404 page:

{exp:redirectee:redirect status="404" url="/404/"}

It doesn't work, instead it shows a blank page, as if that tag wasn't in the template.

I have used the redirectee redirect on another template on the same site, and it works!

What am I doing wrong?

1 Answer 1

2

The problem is that the redirectee plugin use the native PHP header function which not support the 404 code. In fact it is a little bit strange to send a 404 with the header. Therefor you have to use a 302 code, the 404 page will send a 404 code on his page.

As for redirecting with the 404 code, you have the think of this QA:

  • User: Hey, do you have anything for me at this URI webserver?
  • Webserver: Yes, I do, it's a 'PHP' page. It'll tell you what the
    response code is
  • PHP: Hey, OMG 404!!!!!!!
  • Webserver: Well crap, the 404 page people have already gone home, so I'll just send along
    whatever PHP gave me

I just uploaded a new version of the Redirectee with a check on this problem.

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.