Hey, thanks for your replies!
I'll be sure to include a message for every error document the user gets to see, thanks for the tip (almost forgot the obvious part)
Thanks It's true that it's only a server message, but I was just wondering if there's a difference between types of 404's.
If a page doesn't exist and MAYBE never will, then - of course - a 404 is the right message to display. But when a request of the user will never ever be used and give a 200 OK header, maybe we should let the user know? To me it seems a difference between; "Hey, the article isn't there anymore." and "Oops, I made a typo, I'm going to fix the typo and give it another try."
I think I know what you mean, but to be sure, here's the structure;
We use the example page ; domain.com/en/cars/volvo/whats-new-5/
We redirect all urls to index.php?request=your-request
after that we do a regex check; preg_match('#^([a-z]+)(/[a-z]+)?(/[a-z-]+)?(/[a-z0-9-]+)?$#', $_GET['request'])
(front page is a static page)
if this regex returns false, then - this was my idea - there pops up a 400 error.
After that we check every URL by the hand of cached database material to arrays; (no need to check the database every time, the allowed links will not be that dynamic as you can imagine)
$lang['en'] = array(
'region' => 'gb',
'title' => 'English'
... and in the English sitemap ...
$sitemap['cars'] => array(
['c'] => 12,
['volvo'] => 1,
['opel'] => 2
(The 'c' value is for the number of the category.)
It will check and assign numbers to the requested pages and then there will be a connection the database checking if the requested page "whats-new-5" does exist. If not; there will be a 404 error displayed. If the page does exist, we begin loading the data.
NOTE: We use cached database information because of the many database requests we will be using. It's an information/feedback system and we want our website to be as fast as possible. And so, any information that is not dynamic in the long run; we cache.
If anyone has suggestions or corrections, please tell!
Thanks for the help,