CGI question

Gerhard Häring gerhard.haering at opus-gmbh.net
Tue Sep 17 14:28:34 EDT 2002


In article <slrnaoerk7.mgo.jboy at otaku.freeshell.org>, John D. Boy wrote:
> Hello there!
> 
> I am working on a simple CGI script to use as a framework for a website
> of mine. Basically, I want it to work as follows: When somebody accesses
> the site, a CGI (called e.g. index.py) is run. It takes an html-template
> and fills it with content from another file, called e.g. index.dat, and
> returns the completed html-document. When I want to present another
> page, I want the url to look like this: http://my.domain.name/?page. In
> that case, index.py would fill the same template with the content of a
> file called e.g. page.dat. 
> 
> Now, my problem is to find out what follows behind the question mark in
> my CGI script. Unless the key has a value
> (http://my.domain.name/?key=value), it is not in the cgi.FieldStorage
> dictionary. Is it simply impossible, or am I not using the right
> function calls? 

You need to configure your webserver to rewrite URLs from your desired form to
the "/scriptname?key=value form" . I believe the relevant Apache module is
called mod_rewrite.

-- Gerhard



More information about the Python-list mailing list