S
Sean Berry
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.
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
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.
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.
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
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.