Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do i setup .htaccess for a specific directory to not allow specific types of file extension and NOT ALLOW any execution of a the files within that directory?

share|improve this question

You cant.

A .htaccess file could only control the behavior of the webserver. If you are speaking about CGI script, that get executed, than you should configure your CGI directories correct.

Apache does not execute any other file then CGI's.

To forbid the execution of files on system level, you have to remove the x flag. But be careful. If you remove the x flag from a directory, you wont be able to enter it.

share|improve this answer

Your Answer


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.