Jump to content

Turn off PHP and .htaccess files in a sub directory with a .htaccess file?


MrDyne

Recommended Posts

How do I turn off PHP and .htaccess in a directory with a .htaccess file that is one folder up? [/file].htaccessindex.php/files The .htaccess file can't be in the /files directory because it will be accessed by a FTP account and I don't want my friends deleting the .htaccess file and uploading a PHP file or uploading a .htaccess and over riding the parent one. I've tried.

<directory "/files">Order allow,denyDeny from allphp_flag engine offAllowOverride None</directory>

But it throws a 500 Error every time. index.php is what is going to list the files in /files and let people view and download them. ~MrDyne

Link to comment
Share on other sites

In short... you can't do that. You can only enable and disable .htaccess files out of .conf files, which in turn require you to restart Apache after modifications. I think it's a similar deal with PHP, but I'm not entirely sure.

Link to comment
Share on other sites

If a folder is behind /public_www it can't be accessed from the web because /public_www is the website domain.So if I set the FTP account to that folder would .php, .html, .htaccess and web code files be harmless? Cuz then my download page could look in that folder and list the files and let users download the files from the web. But in a harmless form.fopen, fread, if file = php .htm etc header = text/plain, echo file...... I'm just looking for a way to give some of my friends FTP access so they can upload files over the 8MB post limit but prevent them from uploading scripts and screwing with my website.

Link to comment
Share on other sites

.htaccess files would be harmless, but not PHP.For PHP to be harmless, you need to create a user account in the OS for each user, allow this user to only affect their folder, and run PHP as that user.With Apache, you need to use mod_fcgid (forget about running PHP as an Apache module... with it, Apache can only run as the user Apache runs as => PHP has full control of all web sites). I'm not sure exactly how configuration goes though.If you use Windows, it's much more easier to set things up if you use IIS.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...