You need to configure .htaccess so that it acts, or all the settings that it has, work for the entire site except one directory, or disable .htaccess in one directory.

Let's just say: everything that is written to the client in .htaccess , blocks what is needed for the admin.

PS I do not need to deny access to the directory or something like that, but exclude the folder from the actions of the overlying .htaccess .

Update

RewriteRule .* — [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}] RewriteRule .* — [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}] 

It is necessary that the admin cache does not work.

Update

I tried to add Rewrite. Right?

 RewriteCond %{HTTP_HOST} !^/admin/ [NC] RewriteRule .* — [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}] RewriteRule .* — [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}] 
  • one
    It is impossible to exclude a folder from the action of the overlying .htaccess. It is necessary either to hang .htaccess rules so that they would be distributed only to certain folders. Either in the required folder, put .htaccess canceling the rules set in the top (well, or changing to the opposite, as it will) - Mike
  • Well, add him RewriteCond to exclude the catalog - Mike
  • HTTP_HOST is unlikely - because this is just the host name, and you need REQUEST_URI - Mike
  • This option does not work, stupidly loaded forever - marianahmad
  • I don’t think that REQUEST_URI starts with admin, maybe there’s a whole query there, I’m not very strong at rewrite. In general ^ try to remove it, of course it will have to work for all admin folders, but I don’t think there are a lot of them - Mike

1 answer 1

Pre-notification: the solution did not work. I rely on the mention, for example, on this link .


In order to prohibit (in this directory and deeper) the interpretation of .htaccess (located in this directory) and the effect of .htaccess from the upstream directories, you can use the allowoverride none directive within the directory section of the corresponding virtualhost section of the virtualhost configuration.


example.

site docroot: /var/www/site
desired directory: /var/www/site/kata/log

then the configuration will look something like this:

 <virtualhost ...> ... documentroot /var/www/site ... <directory /var/www/site/kata/log> allowoverride none ... </directory> ... </virtualhost>