.htaccess RewriteRule help needed please

Discussion in 'Apache' started by King Goilio, May 16, 2008.

  1. #1
    Hi All,
    I am having a little bit of trouble with this:
    RewriteEngine On
    RewriteRule ^(.*)/(.*)/(.*) map_handle.php?file=$3&username=$1&folder=$2
    PHP:
    But the $1 should stop at the first / and the rest should be in the $2 until the last / where it should be in $3
    atm i am getting this:
    username = test/materials/decals/custom/mani_admin_plugin
    folder = mani_admin_plugin
    file = mani_logo.vtf
    PHP:
    When I want:
    username = test
    folder = materials/decals/custom/mani_admin_plugin
    file = mani_logo.vtf
    PHP:
    Please help
     
    King Goilio, May 16, 2008 IP
    airraid81 likes this.
  2. King Goilio

    King Goilio Member

    Messages:
    200
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    33
    #2
    bump!

    Please Someone Have an answer.
     
    King Goilio, May 19, 2008 IP
  3. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #3
    (.*) is greedy, try (.*?)

    Jay
     
    jayshah, May 19, 2008 IP
    King Goilio likes this.
  4. King Goilio

    King Goilio Member

    Messages:
    200
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    33
    #4
    Thanks a lot
    I have been waiting for someone to reply for 3 days and i couldnt do my website without it.
     
    King Goilio, May 19, 2008 IP
  5. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #5
    Rep would be appreciated ;)

    Thanks,

    Jay
     
    jayshah, May 19, 2008 IP
  6. King Goilio

    King Goilio Member

    Messages:
    200
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    33
    #6
    added rep
    thanks
     
    King Goilio, May 20, 2008 IP
  7. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #7
    Thanks, it's nice to be appreciated :)
     
    jayshah, May 20, 2008 IP