Re: Turning off PHP for one directory with apache

From: Date: Tue, 23 Jan 2001 04:41:41 +0000
Subject: Re: Turning off PHP for one directory with apache
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-36139@lists.php.net to get a copy of this message
Previously, Nold, Mark said: > > After a bit of further playing it appears that simply AddType with the same > extensions that were set up should also stop php from working. > > So in a .htaccess file you can just > AddType text/plain .php4 .php .inc .htm Wouldn't that spit the source code out to the browser though? Personally I would find that undesirable. You could also do something like this, should work in an .htaccess or in the httpd.conf/access.conf files: # Stops .php .php3 .php4 <Files ~ "^.*\.php?$"> order allow,deny deny from all </Files> # Stops .inc <Files ~ "^.*\.inc$"> order allow,deny deny from all </Files> # Stops .htm .html <Files ~ "^.*\.htm?$"> order allow,deny deny from all </Files> -dan -- Dan Lowe <dan@tangledhelix.com> http://tangledhelix.com/ Can vegetarians eat animal crackers? -George Carlin

« previous php.general (#36139) next »