Re: CGI newb... redirect page

From: Sean Berry (sean_berry_at_cox.net)
Date: 05/27/04

  • Next message: Russell Blau: "Re: remove item from list based on name"
    Date: Thu, 27 May 2004 12:08:36 -0700
    
    

    "Sean Berry" <sean_berry@cox.net> wrote in message
    news:Ayqtc.49$VI2.1@fed1read02...
    > Hi there. I am relativly new to Python CGI and need a question answered.
    >
    > I have made custom 404 error pages and have them in various web
    directories.
    >
    > I have not been able to figure out a way to have apache use a file not
    > within it's own
    > home directory, so I was going to have a .py file in cgi-bin forward the
    > user on to the
    > correct error page.
    >
    > So I have say,
    > /usr/www/client1/not-found.shtml
    > and...
    > /usr/www/client2/not-found.shtml
    >
    > I found that cgi.print_environ() gave me the SERVER_NAME, which is what I
    > want.
    > But, this is part of a long html formatted string that cgi.print_environ()
    > returns.

    Okay. I found that usung os.environ yielded the results I was looking for.

    >
    > Is there something builtin to deal with these name, value pairs as a
    > dictionary?
    > I looked throught the docs, but did not see this functionality.
    >
    > Also, when I do extract this info... how do I actually do a redirect to a
    > certain page
    >

    But, I still don't know how to forward, or redirect a page.

    Please help.

    > Example.
    > User goes to www.client1.com/page_not_on_server.html
    > The apache conf file sends the redirect to /cgi-bin/redirect.py
    > Redirect.py extracts the requesting server, client1.com, then
    > redirects them to www.client1.com/not-found.shtml.
    >
    > Thanks for your help.
    >
    >


  • Next message: Russell Blau: "Re: remove item from list based on name"

    Relevant Pages

    • RE: IIS and redirect
      ... In the IIS MMC right click on the Default Web Site and select Properties. ... Select the 'Home Directory' tab. ... If you want this to also redirect to ...
      (microsoft.public.inetserver.iis)
    • redirection on IIS
      ... This can be done by going to the Home directory tab in the ... location to redirect to the url of site1.com/site2. ... >We aim to have our IIS server in house, ... >sites which were hosted by our ISP, ...
      (microsoft.public.inetserver.iis)
    • Re: My Docs Redirect vs Offline Files
      ... I would set their my documents to redirect to their home directory. ... "Devon Cox" wrote in message ... > when not connected to the server. ...
      (microsoft.public.windows.server.sbs)
    • CGI newb... redirect page
      ... I have made custom 404 error pages and have them in various web directories. ... when I do extract this info... ... The apache conf file sends the redirect to /cgi-bin/redirect.py ...
      (comp.lang.python)
    • Re: make the owa (exchange) default
      ... Just change the home directory of the default web site to redirect to a ... I also found this article to be useful for redirecting users from HTTP ...
      (microsoft.public.exchange.connectivity)