I have a url structure that looks something like some_page.php?id=123 and I get the id for that page and that is good.
But sometimes users either edit the url, or one way or another there is no id.
What do people usually do in that case? Should I just redirect the person to a 404 page? Or should I return 404 from that page in case they want to correct the url? Or is 404 the right thing to do in that case?
Also, how do I tell where this user came from?
Thanks!!
404, and don’t redirect. Show them a nice error page but always give them at least the chance to correct the URL.
Also, make sure to actually send the
header('HTTP/1.1 404 Not Found');