I’m creating a new url infrastructure for my sites, and came across this problem:
If I have an extensionless URL like this “/Products/Beverages/Minty-chocolate-drink/Distributors”, I can’t distinguish parameters from pages…
I can find out which page was called by finding the longest match in my pages and treat the rest as parameters, but what about a page-not-found scenario?
An URL like “/Prodcts/Beverages/Minty-chocolate-drink/Distributors” (note wrong spelling in “Prodcts”) will not throw a 404, but instead map to the index page, with all the URL as parameters!
Now, I can segment the parameters with f.ex. [page]/p/[parameters], but that’s pretty unstylish and not very user friendly.
Do you see another solution that would keep the URL in the first example, but enable a page-not-found scenario?
If the index page cannot handle a parameter, it could throw a 404 as well, after all, there is no unique content to display for this URL (even though it maps to a page, but the browser and the user do not know that Products is a parameter rather than a directory), so 404 is perfect.
EDIT: obviously this would go for every page, not only for the index page: if an unknown parameter is found: 404