Htaccess redirect

Discussion in 'PHP' started by Big 'G', Nov 28, 2006.

  1. #1
    i am using Htaccess redirect, but i know need to inlcude a query string in the URL and it doesnt seem to want to do it

    ie
    
    Rewrite Rule ^(.)$ index.php?go=$1
    
    Code (markup):
    but my URL is now has a query string how can i grab it and append to the redirection

    
    Rewrite Rule ^(.)?{I need this query string}$ index.php?go=$1{to attach to here}
    
    Code (markup):
    Racking my brains any ideas or is it just impossible
     
    Big 'G', Nov 28, 2006 IP
  2. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Could you post URL or at least what {to attach to here} is ?
     
    maiahost, Nov 28, 2006 IP
  3. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #3
    it's definitely not impossible.

    rewriterule uses regex. regex stores results based on what's found inside sets of ().

    http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteRule

     
    disgust, Nov 28, 2006 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    
    Rewrite Rule ^(.)?$ index.php?go=$1&%{QUERY_STRING}
    
    Code (markup):
     
    nico_swd, Nov 28, 2006 IP
    Big 'G' likes this.
  5. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #5
    show-off ;-)

    teach a man to fish, etc, etc.
     
    disgust, Nov 28, 2006 IP
  6. Big 'G'

    Big 'G' Member

    Messages:
    89
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    48
    #6
    Cheers all, many thanks to to nico_swd i thought it was {query_string} but didnt put the % in, i should really take a break

    thanks again
     
    Big 'G', Nov 28, 2006 IP