I have read this similar question, but sadly it doesn't quite solve my problem. The public facing part of my static page has the following folder structure:
/srv/htdocs/sub.domain.com/
├── 403.html
├── css
│ ├── bootstrap.min.css
│ ├── bootstrap-theme.min.css
│ └── style.css
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
├── index.html
├── js
│ ├── bootstrap.min.js
│ └── jquery.min.js
└── robots.txt
There are many more folders, but these are the contents I wan't to have publicly available. My idea was to allow unconditional access to the css
, fonts
and js
folders and allow the individual index.html
, 403.html
and robots.txt
files.
<Directory "/srv/htdocs/sub.domain.com">
Order Deny,Allow
Deny from All
<FilesMatch "(403|index)\.html">
Allow from all
</FilesMatch>
<FilesMatch "robots\.txt">
Allow from all
</FilesMatch>
<FilesMatch "/$">
Allow from all
</FilesMatch>
</Directory>
<DirectoryMatch "/(css|js|fonts)" >
Order Allow,Deny
Allow from All
</DirectoryMatch>
I attempted to allow the root with my "empty file" rule "/$"
but that doesn't work. If I only use the rule ""
or "$"
Apache grants access to all files.
When surfing to http://sub.domain.com/
receive a 403 Forbidden
message instead of the index.html
contents. What rule am I missing?