LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-18-2006, 12:39 PM   #1
loccom
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Rep: Reputation: 0
Htaccess and php


Hi

I wish to disable php execution on certain directories

lets say someone uploaded a php file into a images directory and tried to execute the php file the file would not parse through the php parser.

Is this possible to do with htaccess??

many thanks
 
Old 05-18-2006, 02:15 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Take a look at this post.

Regards
 
Old 05-18-2006, 02:51 PM   #3
loccom
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
great thanks.. it worked when placed in the dir

I would like to move the .htaccess to the root of the account and have a list of directories that are php disabled.

do i put the path ie.

/home/mydomain/www/images php_flag engine off

and so on???


many thanks
 
Old 05-19-2006, 03:15 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
I'm afraid this cannot be done. You can either put a .htaccess inside every directory you want to disable php, or use something like:
Code:
<Directory /some/dir1>
...
php_value engine off
</Directory>
<Directory /some/dir2>
...
php_value engine off
</Directory>
to stop php execution in /some/dir1 and /some/dir2
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
htaccess and php automation belorion Programming 3 01-18-2005 05:23 PM
.htaccess + PHP, without password prompt woranl Programming 5 11-26-2004 02:04 PM
php.ini / .htaccess memory issues rioguia Linux - Software 2 11-19-2004 02:41 PM
php and htaccess msound Programming 1 05-01-2004 11:18 PM
.htaccess .html -> .php timmy01 Linux - General 2 09-07-2003 06:30 AM


All times are GMT -5. The time now is 08:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration