NYCPHP Meetup

NYPHP.org

[nycphp-talk] Apache Directives to Disable All Scripts in Sub-Directory?

Michael B Allen ioplex at gmail.com
Tue Oct 2 14:36:03 EDT 2007


On 10/2/07, Matteo Rinaudo <matteo.rinaudo at gmail.com> wrote:
> > I tried the following just to see if I could disable .php but it had no effect.
> >
> >     <Directory /home/me/public_html/code>
> >        RemoveType .php
> >        Order allow,deny
> >        Allow from all
> >        Options Indexes
> >     </Directory>
>
> Hi,
> I am not sure if this helps, but, from the httpd manual:
>
> RemoveType directives are processed after any AddType directives, so
> it is possible they may undo the effects of the latter if both occur
> within the same directory configuration.

As it turns out, this is actually really hard to do.

It does not seem possible to redefine a subdirectory of public_html.
Many directives in .htaccess are just ignored or generate errors when
you know they're supposed to work. I managed to create a separate
directory not under public_html without a .htaccess that worked
(mostly - index.php was still preventing directory indexing).

If would be nice if there was an Apache directive that meant "clear
everything and treat all content as static text/plain,
unconditionally, everwhere".

Mike



More information about the talk mailing list