Htaccess File

joaoramos/joao.pt/master/.htaccess

DEFLATE, REQUEST_URI, SCRIPT_FILENAME
###################################
### Blocks unwanted file access ###
###################################

<IfModule mod_autoindex.c>
  Options -Indexes
</IfModule>

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_URI} "!(^|/).well-known/([^./]+./?)+$" [NC]
  RewriteCond %{SCRIPT_FILENAME} -d [OR]
  RewriteCond %{SCRIPT_FILENAME} -f
  RewriteRule "(^|/)." - [F]
</IfModule>

######################################
### Don't send unnecessary headers ###
######################################

<IfModule mod_headers.c>
  Header unset X-Powered-By
</IfModule>

ServerSignature Off

###################
### 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/x-font-ttf" 
                                  "application/x-javascript" 
                                  "application/xml" 
                                  "font/eot" 
                                  "font/opentype" 
                                  "image/svg+xml" 
                                  "image/x-icon" 
                                  "text/css" 
                                  "text/html" 
                                  "text/javascript" 
                                  "text/plain" 
                                  "text/vcard" 
                                  "text/xml"

  </IfModule>

  <IfModule mod_mime.c>
      AddEncoding gzip              svgz
  </IfModule>
</IfModule>

<IfModule mod_headers.c>
    Header unset ETag
</IfModule>

FileETag None

<IfModule mod_expires.c>
    ExpiresActive on
    ExpiresDefault                                      "access plus 1 month"
  # CSS
    ExpiresByType text/css                              "access plus 1 month"
  # Data interchange
    ExpiresByType application/xml                       "access plus 0 seconds"
    ExpiresByType text/xml                              "access plus 0 seconds"
  # HTML
    ExpiresByType text/html                             "access plus 0 seconds"
  # JavaScript
    ExpiresByType application/javascript                "access plus 1 year"
    ExpiresByType application/x-javascript              "access plus 1 year"
    ExpiresByType text/javascript                       "access plus 1 year"
  # Media files
    ExpiresByType image/jpg                             "access plus 1 month"
    ExpiresByType image/jpeg                            "access plus 1 month"
    ExpiresByType image/png                             "access plus 1 month"
    ExpiresByType image/svg+xml                         "access plus 1 month"
  # Web fonts
    ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
    ExpiresByType font/eot                              "access plus 1 month"
    ExpiresByType font/opentype                         "access plus 1 month"
    ExpiresByType application/x-font-ttf                "access plus 1 month"
    ExpiresByType application/font-woff                 "access plus 1 month"
    ExpiresByType application/x-font-woff               "access plus 1 month"
    ExpiresByType font/woff                             "access plus 1 month"
    ExpiresByType application/font-woff2                "access plus 1 month"
</IfModule>
Exit mobile version