Thing I'm trying to figure out:
-
Thing I'm trying to figure out:
- I want to use .htaccess to block a subdirectory from being accessed. (Because of a reason, the .htaccess cannot go *in* the subdirectory.)
- Lots of SO replies suggest using <Directory "dirname"> with a deny from all.
- But this doesn't work. "<Directory not allowed here".
- Lots of SO posts also agree <Directory> and <Location> are not allowed in .htaccess.
- If it's not allowed it's not allowed. But why do so many people seem to *believe* it's allowed?
-
Thing I'm trying to figure out:
- I want to use .htaccess to block a subdirectory from being accessed. (Because of a reason, the .htaccess cannot go *in* the subdirectory.)
- Lots of SO replies suggest using <Directory "dirname"> with a deny from all.
- But this doesn't work. "<Directory not allowed here".
- Lots of SO posts also agree <Directory> and <Location> are not allowed in .htaccess.
- If it's not allowed it's not allowed. But why do so many people seem to *believe* it's allowed?
@mcc i believe it's permitted if your central server config permits it, but by default it doesn't.
-
@mcc i believe it's permitted if your central server config permits it, but by default it doesn't.
@dysfun@social.treehouse.systems @mcc@mastodon.social according to https://httpd.apache.org/docs/current/mod/overrides.html and https://httpd.apache.org/docs/current/mod/core.html#directory:~:text=directives%20cannot%20nest you can never put a
<Directory>inside a.htaccess(a.htaccessworks like its contents were inside a<Directory>block targeting the directory the file is in, and those blocks don't nest) oh, also https://httpd.apache.org/docs/current/mod/core.html#files:~:text=Note%20that%20unlike
It may be possible to achieve what you want by using aRequire expr "!(%{REQUEST_FILENAME} =~ /\/thesubdir\/)"https://httpd.apache.org/docs/current/mod/mod_authz_core.html#reqexpr -
undefined oblomov@sociale.network shared this topic on