How to handle non-existent subdirectories?
- by Question Overflow
I have a dynamic website with friendly URLs. Example:
Instead of /user.php?id=123, I have /user/123
Instead of /index.php?category=fishes, I have /fishes
But, how do I handle non-existent subdirectories such as /about/123? Currently it gives a 200 success instead of a 404 not found error. Is there a way to deal with non-existent subdirectories in Apache config and at the same time allow for friendly URLs? Or do I have to handle this individually for each PHP script?