I am trying to build a site which has the following pages which needs vanity urls,
- account.php
- questions.php
- profile.php
I need to display
http://www.mysite.com/account?req=settings
http://www.mysite.com/account?req=questions
http://www.mysite.com/account?req=answers
as following
http://www.mysite.com/account/settings
http://www.mysite.com/account/questions
http://www.mysite.com/account/answers
And for the other files I need the following,
etc:-
http://www.mysite.com/questions?id=0484684
As
http://www.mysite.com/questions/0484684
And
http://www.mysite.com/profile?id=123456
as
http://www.mysite.com/profile/123456
Would anyone help me because I really need to make this possible.
I would like to remove the .php extention from the url too.
I like to say that I have no experience in htaccess files.
Thanks for the help, it worked !!!
In your
.htaccessfile, add these rules:You should be able to add new rules based on how these work if you need them in the future.