################################################################################
# Route all requests through "index.php". #
################################################################################
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule . index.php
</IfModule>
################################################################################
# Turn off "on line 0" PHP errors. #
################################################################################
php_flag display_startup_errors off
################################################################################
# Set uploading permissions; max file upload size is lowest of values set here.#
################################################################################
php_value upload_max_filesize 8M
php_value post_max_size 8M
php_value memory_limit 64M
################################################################################
# Enable gzip compression. #
################################################################################
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE application/atom+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/x-component
AddOutputFilterByType DEFLATE text/xml
</Ifmodule>
</Ifmodule>
################################################################################
# Add missing MIME types. #
################################################################################
<IfModule mod_rewrite.c>
AddType image/svg+xml .svg
</IfModule>
################################################################################
# Cleanse headers. #
################################################################################
Header always unset Connection
Header always unset Content-Type
Header always unset Date
Header always unset Expires
Header always unset Keep-Alive
Header always unset Server
Header always unset Transfer-Encoding
Header always unset Vary
Header always unset X-Powered-By
################################################################################
# Add Security. #
################################################################################
Header set Cache-Control "must-revalidate, no-cache, no-store, private"
Header set Content-Security-Policy "default-src 'self';"
Header set Pragma "no-cache"
Header set Public-Key-Pins "pin-sha256=\"0000000000000000000000000000000000000000000=\"; pin-sha256=\"0000000000000000000000000000000000000000000=\"; includeSubDomains; max-age=5184000"
Header set Strict-Transport-Security "includeSubdomains; max-age=5184000; preload"
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
php_flag session.cookie_httponly on
php_flag session.cookie_secure on
php_flag session.use_only_cookies on
php_flag session.use_strict_mode on