> -----Original Message-----
> From: Rich Fernandez [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, July 27, 2001 3:09 PM
> To: [EMAIL PROTECTED]
> Subject: CGI to rewrite a URL
> 
> 
> Hi,
> 
> I've been asked to write a CGI script that takes a URL of the form:
>       https://webserver/cgi-bin/myscript.cgi/myreport
> 
> and redirects the browser to:
>       
> https://webserver/cgi-bin/myscript.cgi/full/path/to/report/myr
eport
>
> In other words, we want to hide the true URL of the report from the
browser.
>
> Can anyone give me an idea about how to start this? Specifically, if I
have a
> script called myscript.cgi, how do I get it to recognize "myreport" as a 
> parameter? It's probably easy to do, but my experience with CGI is next to

> nothing.

1. Use the CGI module:

   use CGI;

   my $q = new CGI;

2. the extra stuff beyond your script name will be in $q->path_info();

3. to send the browser somewhere else, use the redirect method:

   print $q->redirect('http://wherever.you/want/them/to/go');

All nicely documented in 

   perldoc CGI

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to