php - How to setup a permalink structure like wordpress with just postname after the domain name?
My title should be enough to make you understand that what I am actually trying to do. I just want to make a simple permalink structure like this:
I have written all the code to get user request, my code is
$permalink = trim($_SERVER['PHP_SELF'], "/");.
After that I have managed to get the user request when
index.php is added in the URL like this:
But this is not what I am trying to achieve, I just want to simple URL structure like this:
I want a way so that I can get user request without any need of
index.php in the URL.
Thanks, any help will be highly appreciated.
The answer is .htaccess:
See: Redirect everything to index.php