Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have some sites on a server. they all have a drectory named 'image-upload' where users of sites upload their images.

I want to:

  • Off PHP engine for this directory on all the sites

  • disable .htaccess on this directory on all the sites

Can I do it apache config file using regex?

share|improve this question
    
what is the reason of giving negative point to my question? –  hd01 Jul 12 '13 at 13:34

1 Answer 1

You can set configuration options using a FilesMatch and DirectoryMatch directove which uses a globbing patter (not a regex). But you don't even need a glob: just using a Directory directive has the same effect.

The manual describes doing this via .htacess, in your httpd.conf....

<Directory "/var/www/html/image-upload">
   php_flag engine off
   AllowOverride None
</Directory>

(but adding a .htaccess file to disable the engine as well would be a good idea).

It would be a better idea to keep user uploads completely outside the document root and mediate all access via a proxy script.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.