CGI question

John D. Boy info at voidhobo.de
Tue Sep 17 19:24:31 EDT 2002


Thanks to everyone who responded; this was more than I had even hoped
for! I will probably do what you recommended, Ian. I didn't think it
would be as easy as that. It is the most elegant and (even) more
aesthetically pleasing than my initial idea.

Unfortunately, I do not have access to my webserver's configuration to
use the rewrite module, but I will see what I can do within my
.htaccess.

Thanks again, and all the best,
--John

In article <mailman.1032290603.24910.python-list at python.org>, Ian Bicking wrote:
> On Tue, 2002-09-17 at 13:04, John D. Boy wrote:
>> 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. 
> 
> BTW, I wouldn't recommend doing it this way.  If you have a cgi script
> at, say, /page.py, you can access URLs like /page.py/path/to/something
> -- "/path/to/something" will be stored in os.environ['PATH_INFO'].  
> 
> Then your URLs will look like real URLs, and not like queries.  And for
> mod_rewrite people, if you want to serve the root of your domain off
> that script, I believe this will work:
> 
> RewriteEngine On
> RewriteRule ^/(.*)$ /path/to/page.py/$1
> 
> (I don't think you can use Alias in this case, but I might be wrong)
> 
>   Ian


-- 
John D. Boy                               "Information Superhighway" is 
email      <mailto:info at voidhobo.de>       just an anagram for "I'm on 
hypertext  <http://jboy.chaosnet.org>       a huge wispy rhino fart."



More information about the Python-list mailing list