Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # IE Chrome frame
- # ------------------------------------------------
- <IfModule mod_headers.c>
- Header set X-UA-Compatible "IE=Edge,chrome=1"
- <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
- Header unset X-UA-Compatible
- </FilesMatch>
- </IfModule>
- # CORS-enabled images (@crossorigin)
- # ------------------------------------------------
- <IfModule mod_setenvif.c>
- <IfModule mod_headers.c>
- # mod_headers, y u no match by Content-Type?!
- <FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$">
- SetEnvIf Origin ":" IS_CORS
- Header set Access-Control-Allow-Origin "*" env=IS_CORS
- </FilesMatch>
- </IfModule>
- </IfModule>
- # Webfont access
- # ------------------------------------------------
- <IfModule mod_headers.c>
- <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
- Header set Access-Control-Allow-Origin "*"
- </FilesMatch>
- </IfModule>
- # Proper MIME type for all files
- # ------------------------------------------------
- # JavaScript
- AddType application/javascript js
- # Audio
- AddType audio/ogg oga ogg
- AddType audio/mp4 m4a
- # Video
- AddType video/ogg ogv
- AddType video/mp4 mp4 m4v
- AddType video/webm webm
- # SVG
- AddType image/svg+xml svg svgz
- AddEncoding gzip svgz
- # Webfonts
- AddType application/vnd.ms-fontobject eot
- AddType application/x-font-ttf ttf ttc
- AddType font/opentype otf
- AddType application/x-font-woff woff
- # Assorted types
- AddType image/x-icon ico
- AddType image/webp webp
- AddType text/cache-manifest appcache manifest
- AddType text/x-component htc
- AddType application/x-chrome-extension crx
- AddType application/x-opera-extension oex
- AddType application/x-xpinstall xpi
- AddType application/octet-stream safariextz
- AddType application/x-web-app-manifest+json webapp
- AddType text/x-vcard vcf
- # Gzip compression
- # ------------------------------------------------
- <IfModule mod_deflate.c>
- <IfModule mod_setenvif.c>
- <IfModule mod_headers.c>
- SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
- RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
- </IfModule>
- </IfModule>
- <IfModule mod_filter.c>
- AddOutputFilterByType DEFLATE application/atom+xml \
- application/javascript \
- application/json \
- application/rss+xml \
- application/vnd.ms-fontobject \
- application/x-font-ttf \
- application/xhtml+xml \
- application/xml \
- font/opentype \
- image/svg+xml \
- image/x-icon \
- text/css \
- text/html \
- text/plain \
- text/x-component \
- text/xml
- </IfModule>
- </IfModule>
- # Expires headers
- # ------------------------------------------------
- <IfModule mod_expires.c>
- ExpiresActive on
- ExpiresDefault "access plus 1 month"
- ExpiresByType text/cache-manifest "access plus 0 seconds"
- ExpiresByType text/html "access plus 0 seconds"
- ExpiresByType text/xml "access plus 0 seconds"
- ExpiresByType application/xml "access plus 0 seconds"
- ExpiresByType application/json "access plus 0 seconds"
- ExpiresByType application/rss+xml "access plus 1 hour"
- ExpiresByType application/atom+xml "access plus 1 hour"
- ExpiresByType image/x-icon "access plus 1 week"
- ExpiresByType image/gif "access plus 1 month"
- ExpiresByType image/png "access plus 1 month"
- ExpiresByType image/jpg "access plus 1 month"
- ExpiresByType image/jpeg "access plus 1 month"
- ExpiresByType video/ogg "access plus 1 month"
- ExpiresByType audio/ogg "access plus 1 month"
- ExpiresByType video/mp4 "access plus 1 month"
- ExpiresByType video/webm "access plus 1 month"
- ExpiresByType text/x-component "access plus 1 month"
- ExpiresByType application/x-font-ttf "access plus 1 month"
- ExpiresByType font/opentype "access plus 1 month"
- ExpiresByType application/x-font-woff "access plus 1 month"
- ExpiresByType image/svg+xml "access plus 1 month"
- ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
- ExpiresByType text/css "access plus 1 year"
- ExpiresByType application/javascript "access plus 1 year"
- </IfModule>
- # ETag removal
- # ------------------------------------------------
- <IfModule mod_headers.c>
- Header unset ETag
- </IfModule>
- FileETag None
- # Start rewrite engine
- # ------------------------------------------------
- <IfModule mod_rewrite.c>
- Options +FollowSymlinks
- RewriteEngine On
- </IfModule>
- # Suppress or force the "www." at the beginning of URLs
- # ------------------------------------------------
- <IfModule mod_rewrite.c>
- RewriteCond %{HTTPS} !=on
- RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
- RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
- </IfModule>
- # Custom 404 page
- # ------------------------------------------------
- ErrorDocument 404 /404.html
- # UTF-8 encoding
- # ------------------------------------------------
- AddDefaultCharset utf-8
- AddCharset utf-8 .atom .css .js .json .rss .vtt .xml
- # Security
- # ------------------------------------------------
- <IfModule mod_autoindex.c>
- Options -Indexes
- </IfModule>
- <IfModule mod_rewrite.c>
- RewriteCond %{SCRIPT_FILENAME} -d
- RewriteCond %{SCRIPT_FILENAME} -f
- RewriteRule "(^|/)\." - [F]
- </IfModule>
- <FilesMatch "(\.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist)|~)$">
- Order allow,deny
- Deny from all
- Satisfy All
- </FilesMatch>
- <IfModule php5_module>
- php_value session.cookie_httponly true
- </IfModule>
- RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
- RewriteCond %{QUERY_STRING} ^(.*)=http [NC]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement