Pls help on modrewriting : will give 6$ via paypal :)

Discussion in 'Apache' started by sarathy, Dec 26, 2005.

  1. #1
    hi guyz.,
    we curently have urls in the format:
    ser.<domain.com>/cgi-bin/viewprofile.cgi?ID=A123456


    I would like to do a rewrite so that when i type:
    domain.com/A123456
    it shows the content from
    ser.<domain.com>/cgi-bin/viewprofile.cgi?ID=A123456

    Is this possible.,

    will give 6$ via paypal for working code. :)

    Thanks
    Sarathy.s
     
    sarathy, Dec 26, 2005 IP
  2. solaris125

    solaris125 Guest

    Messages:
    103
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteEngine on
    RewriteRule ^([^/\.]+)/?$ /cgi-bin/viewprofile.cgi?ID=$1
     
    solaris125, Dec 26, 2005 IP
  3. sarathy

    sarathy Peon

    Messages:
    1,613
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks solaris, Its not working.,

    Where do i put this code?.

    In the .htaccess of domain.com or
    in the .htaccess of ser.domain.com ?

    Regards.,
    Sarathy.s
     
    sarathy, Dec 27, 2005 IP
  4. sarathy

    sarathy Peon

    Messages:
    1,613
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #4
    WIll pay 15$ for a working code now :)
     
    sarathy, Dec 27, 2005 IP
  5. kniveswood

    kniveswood Well-Known Member

    Messages:
    764
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Alright, I tried but I can't seem to get it to work on my cgi-bin folder. Any other folder seems fine. You might wanna give it a try anyway:

    RewriteEngine on
    RewriteRule ^([a-zA-Z0-9]+) cgi-bin/viewprofile.cgi?ID=$1 [QSA,L]

    Put it in your ser.domain.com's htaccess.
     
    kniveswood, Dec 28, 2005 IP
  6. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi,

    You want to go from one (sub)domain to another. You need to use either a redirect or you need to make the path to ser.domain.com/cgi-bin/viewprofile.cgi available under domain.com.

    For the redirect, try (not tested) in your domain.com's .htaccess:
    RewriteRule ^([a-zA-Z0-9]+)$ http://ser.domain.com/cgi-bin/viewprofile.cgi?ID=$1
    Code (markup):
    For the other (better) solution, I need the path under domain.com.

    I do not need $$$, but I need inbound links.:D

    Jean-Luc
     
    Jean-Luc, Dec 28, 2005 IP
  7. sarathy

    sarathy Peon

    Messages:
    1,613
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #7
    kniveswood thanks for the reply. That dint work :(

    Hi Jean, That works, But the command directly redirects to the subdomain :).

    domain.com/A1234 redirects directly
    to
    ser.domain.com/cgi-bin/view.cgi?ID=A637134

    Further domain and ser.domain.com are under 2 different servers :)
     
    sarathy, Dec 28, 2005 IP