Routing redirection decision

Posted by programming late night on Stack Overflow See other posts from Stack Overflow or by programming late night
Published on 2010-03-28T22:40:30Z Indexed on 2010/03/28 22:43 UTC
Read the original article Hit count: 230

Filed under:
|
|

I have really no idea why I'm asking this as this a really completely irrelevant question for which I should have figured out an answer within milliseconds, yet I'm doing it.

So in my project I have a Router class which splits up the request and selects the right page to be loaded. Fine so far.

Now I have a page displayed when the user requests a page that doesn't exist, you know, 404.

So theoretically, if the user entered mydomain.com/404 (I use mod_rewrite with a requests collector via index.php?req=*) the 404 error would be shown to him, but in fact there was no error - the 404 page would be displayed as a perfectly normal page.

So if someone would try out requesting the 404 page via /404, he would be shown the page but he can't tell if the 404 page he requested doesn't exist and he is actually getting a, you guessed it, 404 error or if he actually found some flaw in the system that makes him able to see an error page when there is no error.

I don't know how dumb this whole thing here is but I'm sure some of you have in fact ran into this problem already.

Short version: If the user enters mydomain.com/404 the 404 page is shown even though there is no 404 error. I know this is a completely irrelevant question, please don't tell me, but I just spontaneously wanted to hear your thoughts on it. Strange eh?

  • Should I redirect direct access to my 404-page to the home page?
  • Should I do nothing?
  • Should I just go to bed and stop asking irrelevant stuff?

© Stack Overflow or respective owner

Related posts about php

Related posts about design-patterns