1

I have a folder 'includes' on my apache server where I keep some php and other automation documents. The folder contains the .htaccess file below.

<Limit POST PUT>
  order deny,allow
  deny from all
  allow from 127.0.0.1
</Limit>
Options -Indexes

This restricts some access to the files in this folder and its subfolders. And works fine.

How can I have custom read access settings in one of the subfolders?

  • Example 1: One folder includes/exampleone I want to disallow Get requests.
  • Example 2: A second folder includes/exampletwo I want to allow all, for dev/test purposes.

Is it as simple as putting a new htaccess file in the subfolders? I tried that for example 2 and used the below

<Limit POST PUT GET>
  order deny,allow
  deny from none
  allow from all
</Limit>
Options -Indexes

But got a page missing error navigating to the directory or a .php file within it.

square_eyes
  • 1,269
  • 3
  • 22
  • 52
  • possible duplicate of [.htaccess. deny root, allow specific subfolder. Possible?](http://stackoverflow.com/questions/7649794/htaccess-deny-root-allow-specific-subfolder-possible) – Asenar Nov 05 '13 at 17:31
  • Thanks I hadn't seen that one. Although I did search. Still though, I did try that, yet the page in example two is still not found. – square_eyes Nov 05 '13 at 17:35
  • To be clear, I tried as above and also `Order allow,deny Allow from all` from your link and got the same result. – square_eyes Nov 05 '13 at 18:00
  • I made a test with exactly your code (+ limit GET in the first .htaccess) and that's works fine. So maybe it's an error inside the .php or about apache configuration – Asenar Nov 06 '13 at 09:59
  • OK thanks, I'll have another play and see how I go. At least now I know it should be possible. – square_eyes Nov 06 '13 at 13:07

0 Answers0