I have the following .htaccess file used in the web home of Apache2 in a Docker container:
# allows HTML files to be interpretted as PHP files AddType application/x-httpd-php .html # allows redirect to *.html files without using the extension # e.g., http://example.com/foo will show http://example.com/foo.html <IfModule mod_rewrite.c> Options All RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.html -f #RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [L] RewriteRule !.*\.html$ %{REQUEST_URI}.html [L] # causes redirect from HTTP to HTTPS RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </IfModule> Options -Indexes # environament variables SetEnv DBL "mysql:dbname=roars;host=foo;port=3306" SetEnv DB_USER "bar" SetEnv DB_PASS "glorp" The Options -Indexes directive is not keeping us from being able to view directories. All of the other directives work properly and when I use this .htaccess file outside of a Docker container it works appropriately by disallowing the viewing of a directory.
Have I done something wrong, or is this particular to Docker containers?