rewrite_mod combinated with $_GET

Discussion in 'PHP' started by bishopx, Apr 3, 2010.

  1. #1
    Hello,

    I have a problem.
    I use .htaccess for rewriting links. But, I can't get it work with $_GET together.
    example:
    domena.sk/index.php?var1=stranka&var2=neco
    Code (markup):
    rewrites to
    domena.sk/stranka/neco/
    Code (markup):
    I want to use it with $_GET
    domena.sk/stranka/neco/?something=nic
    Code (markup):
    And than I want to get $_GET value
    $_GET['something']
    Code (markup):
    via PHP.

    Is there any solution for this?
     
    bishopx, Apr 3, 2010 IP
  2. Brandon.Add.On

    Brandon.Add.On Peon

    Messages:
    178
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could make 2 variables with the same value one for .htaccess to use and the other for PHP.
     
    Brandon.Add.On, Apr 3, 2010 IP
  3. krsix

    krsix Peon

    Messages:
    435
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Will [QSA] work?
     
    krsix, Apr 3, 2010 IP
  4. Brandon.Add.On

    Brandon.Add.On Peon

    Messages:
    178
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That would append both variables to the end of the new rewritten URL. You will want just the second var, the one that PHP uses.
     
    Brandon.Add.On, Apr 3, 2010 IP
  5. bishopx

    bishopx Well-Known Member

    Messages:
    107
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #5
    Flag [QSA,L] helped me out.

    Thank you !
     
    bishopx, Apr 4, 2010 IP