.htaccess Help

Discussion in 'Apache' started by Hyphen, Sep 22, 2009.

  1. #1
    Hyphen, Sep 22, 2009 IP
  2. chadsmith

    chadsmith Peon

    Messages:
    82
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you do a 301 redirect it should keep the original referrer. Try:

    RewriteCond %{QUERY_STRING} ^redir=(.+)$
    RewriteRule ^$ %1? [R=301,L]
    Code (markup):
     
    chadsmith, Sep 24, 2009 IP
  3. Hyphen

    Hyphen Well-Known Member

    Messages:
    464
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #3
    I'm trying not to keep the referer, but when I try this in my .htaccess and go to http://www.domain.com/?redir=http://www.google.com/, it doesn't take me to Google, it takes me to that raw URL.
     
    Hyphen, Sep 24, 2009 IP
  4. chadsmith

    chadsmith Peon

    Messages:
    82
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It works on my end. Is there an actual file you're using, such as:

    http://www.domain.com/somepage?redir=http://www.google.com/

    or is it just

    http://www.domain.com/?redir=http://www.google.com/

    The http:// also has to be in the redirect for it to work.
     
    chadsmith, Sep 24, 2009 IP
  5. Hyphen

    Hyphen Well-Known Member

    Messages:
    464
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Hyphen, Sep 27, 2009 IP
  6. chadsmith

    chadsmith Peon

    Messages:
    82
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Nope. Can you PM me the domain so I can take a look?
     
    chadsmith, Sep 27, 2009 IP