On Fri, 08 Jun 2007 10:57:25 +0200
Luca Longinotti <[EMAIL PROTECTED]> wrote:

> Korthrun wrote:
> > It seems to me that when I setup .cgi and .pl via an addhandler
> > statement such as:
> > 
> > AddHandler cgi-script .cgi .pl
> > 
> > apache will try to execute anything containing .pl or .cgi.
> > 
> > If i have a file, foo.pl for example.
> > http://localhost/foo.pl will execute (good)
> > now if I move it to foo.txt
> > http://localhost/foo.txt will show me the contents of the file
> > (good) now if I move it to foo.pl.txt
> > http://localhost/foo.pl.txt will try to execute it, as it will if i
> > canme it foo.cgi.txt.
> > calling it foo.php.txt will still print it out, but the new lines
> > are stripped etc, it looks like it's been run through and spat out
> > php.
> > 
> > Is this intended behaviour? It kind of seems like something gone
> > wrong.
> 
> Yup, it is intended, check the doc:
> 
> http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler
> 
> "Once that has been put into your httpd.conf file, any file containing
> the .cgi extension will be treated as a CGI program."
> 
> The keyword here is "containing", not "ending with", which may be
> surprising, but it is so. :)

I think AddType is what you're after.

Cheers,

Brad

Attachment: signature.asc
Description: PGP signature

Reply via email to