httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mathieu...@laposte.net
Subject [users@httpd] Complex combination of Allow and Deny for Apache
Date Mon, 08 Jun 2015 19:51:23 GMT
Hello 

With Apache, I searched to deny access to all *.php URL in a subdirectory. I succeed with
this in .htaccess :
***************************
Order deny,allow
Allow from All

<Files ~ "^.*\.php$">
    Deny from All
</Files>
***************************

But now, I want to add a extra access for one single URL who was denied. I made a lot of test
but a obtained only no effect or "error 500" for example with this :
***************************
Order deny,allow
Allow from All

<Directory "/home/site/www/repertoire1/repertoire2/">
    <Files "fichier.php">
        Allow from All
    </Files>
</Directory>

<Files ~ "^.*\.php$">
    Deny from All
</Files>
***************************

this .htaccess is in "repertoire1" and the URL I want to allow is http://example.com/repertoire1/repertoire2/fichier.php
I cannot put files in the directory "repertoire2" then I want to put all access rules in one
single .htaccess file


Thank you for everyone that can help me to understand how the access rules work.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message