Routing redirection decision

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?

Answers


I think you shouldn't do anything. When the user receives a 404 error, the HTTP response code should be 404. When they request the 404 page, the HTTP response code should be 200 (OK), even though the page content is the same.

Being able to link to people's 404 pages is useful sometimes, especially if they are witty.


Need Your Help

python setup.py configuration to install files in custom directories

python configuration installation setup.py

I want to create a setup.py which would install my files into custom directories. I have a certain prefix, where I would like to get the following result:

How do I estimate camera pose from two sets of features in openCV?

opencv image-processing computer-vision opencv3.0

I have a sequence of images. I would like to estimate the camera pose for each frame in my sequence.