LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > Disable PHP in a directory

Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2010, 12:42 AM
Druciak Druciak is offline
Member
 
Join Date: Apr 2006
Posts: 12
Default Disable PHP in a directory

How can I disable php in some directory?
Reply With Quote
  #2  
Old 11-15-2010, 01:20 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
can use rewrite rule to prevent it.
in .htaccess at that directory:

RewriteEngine on
RewriteRule (.*)php$ - [F]
Reply With Quote
  #3  
Old 11-15-2010, 01:48 AM
Druciak Druciak is offline
Member
 
Join Date: Apr 2006
Posts: 12
I try to use
'php_flag engine off' in a .htaccess file in that directory but its not working.
Reply With Quote
  #4  
Old 11-15-2010, 02:18 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,339
Do not use 'php_flag engine on/off' in .htaccess for now. It will be supported in the future releases.

php is handled by External Handler (lsphp5 by default). To disable php per directory, .htaccess is the way to go:

1. turn on .htaccess for the vhost (Vhost->General->HTAccess -> check FileInfo at least)

2. to block php (HTTP 403 returned), put the following lines in the .htaccess under the directory desired:
Options -ExecCGI
AddHandler .php
or the rewrite rules NiteWave suggested above.

or

2. to block php but allow source to display, put the following line in the .htaccess:
RemoveType .php
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:42 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.