Skip to content

Instantly share code, notes, and snippets.

@kikmedia
Last active August 29, 2015 14:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kikmedia/b5a4a647b996a3edadb3 to your computer and use it in GitHub Desktop.
Save kikmedia/b5a4a647b996a3edadb3 to your computer and use it in GitHub Desktop.
New .htaccess settings for Contao 2.11.x / Apache 2.4
##
# New Apache 2.4 syntax
##
# Prevent access to the Contao template files
##
<FilesMatch "\.(tpl|html5|xhtml)$">
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
</FilesMatch>
##
# Allow access from all domains for webfonts
# @see https://github.com/h5bp/html5-boilerplate
##
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff2?|font\.css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
(...)
##
# New Apache 2.4 syntax
##
# Gzip compression
# @see https://github.com/h5bp/html5-boilerplate
##
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</IfModule>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment