In WordPress it is possible to have urls such as sitename.com/post-title although there exists no directory with name post-name.
I guess that index.php (or may be 404 page) must be handling such kind of requests.
Anyone please explain the exact trick behind this…
Read about Mod Rewrite basics in this page. It’s an Apache module that allows you to parse a request content and redirect it to a “real” page without changing browser address.
Let’s say you have this:
With such a rewrite rule, a request address looking like:
Will be redirected to:
And this is better on a point of view of both aesthetics Search Engine Optimization.
To be specific, in WordPress every request is redirected to index.php page which contains an internal “parser” of the request that loads the content depending on the parsing result.
नमस्ते!