3-strand-code/3sc-blog/master/themes/Casper2Pelican/static/.htaccess - Htaccess File


AddDefaultCharset utf-8
ErrorDocument 404  /404.html
Options All -Indexes
ServerSignature Off
RewriteEngine On
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://blog.abr4xas.org/$1 [R,L]
Options +FollowSymlinks
FileETag None
RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)=http [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
RewriteCond %{QUERY_STRING} (<|%3C).*iframe.*(>|%3E) [NC,OR]
# GZip Files
<FilesMatch ".(htm|html|php|css|js)$">
   AddHandler application/x-httpd-php .html
<FilesMatch ".(htm|html|php|xml|css|js)$">
   SetOutputFilter DEFLATE
<IfModule mod_deflate.c>
   AddOutputFilterByType DEFLATE text/html text/plain text/css application/json text/xml  application/xml
   AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript text/x-component
   SetOutputFilter DEFLATE
<IfModule mod_expires.c>
  ExpiresActive on
  ExpiresDefault A0
  ExpiresByType text/cache-manifest A2592000
  ExpiresByType text/html A2592000
  ExpiresByType text/xml A2592000
  ExpiresByType application/xml A2592000
  ExpiresByType application/json A2592000
  ExpiresByType application/rss+xml A2592000
  ExpiresByType image/jpg "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType text/css "access plus 1 year"
  ExpiresByType text/x-javascript "access plus 1 year"
  ExpiresByType image/x-icon "access plus 1 year"
  ExpiresByType application/javascript "access plus 1 year"
  ExpiresByType image/x-icon  "access plus 1 year"
  ExpiresByType text/javascript "access plus 1 year"
# A2592000 means 1 month in the future (60*60*24*30=2592000)
  <IfModule mod_headers.c>
    Header append Cache-Control "public"
<IfModule mod_headers.c>
 #KeepAlive On
 Header set Connection keep-alive
 ExpiresActive On
 ExpiresDefault A0
  # YEAR
  <FilesMatch ".(ico|gif|jpg|jpeg|png|flv|pdf|js|css|swf|xml|mp3)$">
   Header set Cache-Control "max-age=29030400"
   ExpiresDefault A29030400
   Header append Cache-Control "public"
   RequestHeader unset Cookie
   Header always unset Set-Cookie
   Header unset ETag
  # 10 min
  <FilesMatch ".(html|htm|txt|php)$">
   Header set Cache-Control "max-age=2700"
   Header append Cache-Control "public, must-revalidate"
   ExpiresDefault A600
SetEnv SERVER_ADMIN me@abr4xas.org

On Github License


Download PDF of Htaccess file