getting the path in a cgi script

K

Kalle Anke

I know I've done this once before ... I think ... but now I can't figure out
how to do it

I've set my web server to use an alias similar to this

ScriptAlias /xx/ "/Library/WebServer/CGI-Executables/xxx.cgi/"

which makes it possible for me to write

http://127.0.0.1/xx/some/kind/of/path

my problem is that I don't know how to get the 'some/kind/of/path' part of
the URL in my script.

I know that I can do like this in perl

$documentRoot.path_info();

but how do I do it in python?
 
F

Fredrik Lundh

Kalle said:
I know I've done this once before ... I think ... but now I can't figure out
how to do it

I've set my web server to use an alias similar to this

ScriptAlias /xx/ "/Library/WebServer/CGI-Executables/xxx.cgi/"

which makes it possible for me to write

http://127.0.0.1/xx/some/kind/of/path

my problem is that I don't know how to get the 'some/kind/of/path' part of
the URL in my script.

I know that I can do like this in perl

$documentRoot.path_info();

but how do I do it in python?

import os
path_info = os.environ.get("PATH_INFO")

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,268
Messages
2,571,344
Members
48,019
Latest member
Migration_Expert

Latest Threads

Top