I am building a php site(raw coding). I want to modify the url. i think htaccess is the solution. but i am weak is this. can u people help me about this? my urls are like these:
- http://www.site.com/index.php
- http://www.site.com/invoice_details.php?invoice_id=100
- http://www.site.com/user.php?uid=20&type=1
- http://www.site.com/client_details.php?cid=10&status=active
I want these to be like:(1st choice)
- http://www.site.com
- http://www.site.com/invoice-details/100
- http://www.site.com/user/20/1
- http://www.site.com/client-details/10/active
Or may be just add “slash” and replace the “_” with “-“(2nd choice)
You can solve that using mod_rewrite, which can be configured in .htaccess files.
For example, to solve your number 1 and 2:
There’s masses of information online, this http://www.workingwith.me.uk/articles/scripting/mod_rewrite seems like a reasonable introduction.