#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    71
    Rep Power
    11

    Redirecting a web page on server side


    Hi, I need some help here please..
    I'm using apache as a web server.
    How can I perform redirection on server side with python?
    Thank you very much
    Roy
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    If you can avoid sending any other MIME headers, Content-Type for instance all you have to do is print this...

    Code:
    #!/usr/bin/env python
    
    print 'Location: http://www.python.org\n'
    This will redirect the page to python.org using Python CGI .

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    71
    Rep Power
    11

    A bit of a problem...


    Originally Posted by netytan
    If you can avoid sending any other MIME headers, Content-Type for instance all you have to do is print this...

    Code:
    #!/usr/bin/env python
    
    print 'Location: http://www.python.org\n'
    This will redirect the page to python.org using Python CGI .

    Mark.
    Hi Mark.
    Thanks for your reply.
    The situation is, that I have a login page that authenticates the user,
    if the user is authenticated then :
    1. An header with cookie ( sessionID ) is sent to the client
    2. A redirect for a different page is required.
    How can I achieve that ?
    Cheers
    Roy

IMN logo majestic logo threadwatch logo seochat tools logo