seeddms-code/.htaccess
2021-03-10 11:59:19 +01:00

35 lines
1.1 KiB
ApacheConf

Options -Indexes
<IfModule mod_headers.c>
Header set Strict-Transport-Security: "max-age=15768000; includeSubDomains; preload"
Header set X-Content-Type-Options: "nosniff"
</IfModule>
RewriteEngine On
RewriteRule ^favicon.ico$ styles/bootstrap/favicon.ico [L]
# Store the current location in an environment variable CWD to use
# mod_rewrite in .htaccess files without knowing the RewriteBase
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ - [E=CWD:%2]
# Do not allow access on the other directories in www
RewriteRule "^utils/.*$" "" [F]
RewriteRule "^doc/.*$" "" [F]
# Anything below the following dirs will never be rewritten
RewriteRule "^pdfviewer/.*$" "-" [L]
RewriteRule "^views/.*/images.*$" "-" [L]
RewriteRule "^out/images.*$" "-" [L]
RewriteRule "^styles/.*$" "-" [L]
# Accessing a file in an extension is always possible
# Added for old extensions which do not use routes
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule "^ext/.*$" "-" [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^.*$ %{ENV:CWD}index.php [QSA,L]