Re: Complex combination of Allow and Deny for Apache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



you can't add <Directory entries in a .htaccess file

about the files entry, maybe you could include it all in a single regex _expression_.

2015-06-08 21:51 GMT+02:00 <mathieu700@xxxxxxxxxxx>:
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@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




--
Daniel Ferradal
IT Specialist

email         dferradal at gmail.com

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux