The script will be invoked from a URL such as example.com/photo.php?id=123or example.com/photos/123, depending on whether cute URLs are included.
example.com/photo.php?id=123
example.com/photos/123
If photo No. 123 does not exist, the request example.com/photos/123should return a 404 error. But what about example.com/photo.php?id=123?
The relevant RFC is 2616, in particular the sections status codes , and URIs . In particular, the query string is considered part of the URI, therefore it 404is the correct answer, as it means:
404
Request-URI.
, , 410.
410
200 : " ".
200
...?id=123, .../123 , - .
...?id=123
.../123
, 404 - , . 404 :
404 - @# $@# $@!
404 URL-, ...photo.php, ( , ), - - : , - .
...photo.php
, .
photo.php?id=123 - , 123, , 404. 404 , , , - .
photo.php?id=123
, , photo.php?id=123 , , 123, 200 , .
, . , HTTP , , , 404 . , , , .
TL; DR 404.
, 404, :
, Request-URI. , .
, 410:
,
I think you should throw 404. This can easily be done using the .htaccess file,
Hope this helps,