#1
  1. Web Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Inida - Gujarat - Rajkot
    Posts
    389
    Rep Power
    0

    Thumbs up How to change URL Parameters through .htaccess?


    Hello Friends

    In my website I am passing this type of parameters index.php?K=A But Now I want instead of this.. It should be come like this way index.php/K/A

    So what I have to do for this? what thing i have to write in .htaccess file? any idea?

    I will be thankful for them...
  2. #2
  3. Kontributin' Uza
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2004
    Location
    Wiltshire, UK
    Posts
    1,095
    Rep Power
    78
    Take a look at ModRewrite.
    It does exactly what you are after and this tutorial by jharnois is excellent.

    Click Here.
  4. #3
  5. No Profile Picture
    Brony & F/OSS Advocate
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2003
    Location
    Anaheim, CA (USA)
    Posts
    6,655
    Rep Power
    2476
    Moved from PHP Development to Apache Development.
    ~~ Peter ~~ :: ( Who am I? ) :: ( Peter's Musings: Uploading myself, bit by bit... ) :: ( Electronic Frontier Foundation ) :: ( I'm a GNU/Linux addict and Free Software Advocate. ) :: ( How to Ask Questions the Smart Way ) :: ( The Fedora Project, sponsored by Red Hat ) :: ( GNOME: The Free Software Desktop Project ) :: ( GnuPG Public Key ) :: ( About me on the WIki )
  6. #4
  7. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    So what have you tried? Have you followed the guide?

    --Simon
  8. #5
  9. Kontributin' Uza
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2004
    Location
    Wiltshire, UK
    Posts
    1,095
    Rep Power
    78
    Originally Posted by SimonGreenhill
    So what have you tried? Have you followed the guide?
    --Simon
    Simon...eh??

    I already suggested that.....See my post above?!?!
  10. #6
  11. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    just trying to get my post count up

    --Simon

    Comments on this post

    • codergeek42 agrees : And your rep power too? :o
  12. #7
  13. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    Originally Posted by bluedragon
    Simon...eh??

    I already suggested that.....See my post above?!?!
    I was going to warn him, but that's my post you're linking to ...
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2008
    Posts
    6
    Rep Power
    0

    Sarmad Mahar


    Simply copy past blow line in your .htaccess file

    RewriteRule ^K/(.+) index.php?k=$1

    this will become
    http://www.yourdomail.com/K/A



    Originally Posted by amarvora
    Hello Friends

    In my website I am passing this type of parameters index.php?K=A But Now I want instead of this.. It should be come like this way index.php/K/A

    So what I have to do for this? what thing i have to write in .htaccess file? any idea?

    I will be thankful for them...

IMN logo majestic logo threadwatch logo seochat tools logo