Mod rewrite question

Discussion in 'Apache' started by strogg, Jan 12, 2008.

  1. #1
    I have url's like this

    http://localhost/myproject/show.php?category=travel1&member=derek&ID=3
    Code (markup):
    I can rewrite to directory style, like this

    http://localhost/myproject/travel/derek/3
    Code (markup):
    But I want to short url's like this Is

    Category + member
    http://localhost/myproject/travel/derek
    Code (markup):
    or very short one

    just member
    http://localhost/myproject/derek
    Code (markup):
    is this possible?
     
    strogg, Jan 12, 2008 IP
  2. strogg

    strogg Peon

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    strogg, Jan 12, 2008 IP
  3. lv211

    lv211 Peon

    Messages:
    168
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.*)/(.*)/ show.php?category=$1&member=$2&ID=3 [L]


    put .htaccess in the myproject directory
     
    lv211, Jan 13, 2008 IP
  4. strogg

    strogg Peon

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    ok thank you
     
    strogg, Jan 18, 2008 IP