how to redirect multiple variable url with htaccess

Discussion in 'PHP' started by dineshsingh1984, Apr 8, 2012.

  1. #1
    dineshsingh1984, Apr 8, 2012 IP
  2. MarPlo

    MarPlo Member

    Messages:
    97
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    48
    #2
    Hi,
    Try this rewrite rule:
    RewriteRule ^demo.php/([^/]+)/([^/]+)/([A-Za-z0-9_-]+)$ demo.php?var1=$1&var2=$2&var3=$3 [NC,L]
    Code (markup):
     
    MarPlo, Apr 8, 2012 IP
  3. filegrasper

    filegrasper Active Member

    Messages:
    493
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    ^^^^ It has to work well.
     
    filegrasper, Apr 8, 2012 IP
  4. dineshsingh1984

    dineshsingh1984 Active Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    hey MarPlo,

    RewriteRule ^demo.php/([^/]+)/([^/]+)/([A-Za-z0-9_-]+)$ demo.php?var1=$1&var2=$2&var3=$3 [NC,L]

    i am try this code but it's not work
    I think in this code required RewriteCond.....

    So, plz tell me some other..........
     
    Last edited: Apr 9, 2012
    dineshsingh1984, Apr 9, 2012 IP
  5. MarPlo

    MarPlo Member

    Messages:
    97
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    48
    #5
    Hi,
    Try with this code:
    
    Options +FollowSymLinks
    RewriteEngine On
    
    RewriteRule ^demo.php/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ demo.php?var1=$1&var2=$2&var3=$3 [NC,L]
    
    Code (markup):
    If it not works, maybe the server not supports mod-rewrite. I don't know other solution, maybe someone else.
     
    MarPlo, Apr 9, 2012 IP