.htaccess ?id=x redirect

Discussion in 'Programming' started by Domen Lombergar, Jun 15, 2007.

  1. #1
    Hey guys. I'm banging my head off a problem I'm having with the redirecting.

    Basically my domain had the following URLs for a while:

    lombergar.com/go/?i=lombi04

    now I want these links to redirect to the main page while retaining the referrer data (but ignoring the ?i= thingie).

    I've been playing with both redirectmatch and rewriterule but I can't get any of those to also ignore the ?i=lombi04 - what they basically do is redirect to lombergar.com/?i=lombi04

    Does anyone know how to overcome this?

    Thanks so much!
     
    Domen Lombergar, Jun 15, 2007 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    lets have a look at your .htaccess
     
    krakjoe, Jun 15, 2007 IP
  3. Domen Lombergar

    Domen Lombergar Peon

    Messages:
    106
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's currently the following:

    RedirectMatch 301 /go/?i=(.*)$ http://www.lombergar.com
    Code (markup):
     
    Domen Lombergar, Jun 15, 2007 IP
  4. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #4
    typically you would redirect to something like go.php and do whatever you need to do with the referrer data and then use header() to redirect to your index.
     
    krakjoe, Jun 15, 2007 IP
  5. Domen Lombergar

    Domen Lombergar Peon

    Messages:
    106
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Good idea, did what you asked, thanks.
     
    Domen Lombergar, Jun 16, 2007 IP