When you edit a question on stackoverflow.com, you will be redirected to a URL like this:
But usually, it should be
or
How was
I know that Stackoverflow.com was not created by using PHP, but I am wondering how to achieve this in PHP?
When you edit a question on stackoverflow.com, you will be redirected to a URL like this:
But usually, it should be
or
How was
I know that Stackoverflow.com was not created by using PHP, but I am wondering how to achieve this in PHP?
With apache and PHP, you might perform one of your examples using a mod_rewrite rule in your apache config as follows:
This looks for URLs of the "clean" form, and then rewrites them so that they are internally redirected to a particular PHP script.
Quite often rules like this are used to route all requests into a common controller script, which might do something like instantiate a "PostsController" class and ask it to handle an edit request. This is a common feature of most PHP application frameworks.
Using mod_rewrite this can be achieved very easily.