damianb/tf2stats/master/.htaccess - Htaccess File

damianb/tf2stats/master/.htaccess

#
# Copyright (c) 2011 scrii.com
# Licensed under the GPLv3
# Available at http://github.com/damianb/tf2stats
#

# Provide support for gz compressed stylesheets/js files
<IfModule mime_module>
  AddEncoding x-gzip .gz .tgz
  AddType text/css .css.gz
  AddType application/javascript .js.gz
</IfModule>

# Asset caching
<IfModule mod_headers.c>
  <FilesMatch ".(css|css.gz)$">
    # 2 day cache
    Header set Cache-Control "public, max-age=172800"
    Header set X-Content-Type-Options "nosniff"
    Header set Content-Type "text/css; charset=UTF-8"
  </FilesMatch>

  <FilesMatch ".(js|js.gz)$">
    # 2 day cache
    Header set Cache-Control "public, max-age=172800"
    Header set X-Content-Type-Options "nosniff"
    Header set Content-Type "application/javascript; charset=UTF-8"
  </FilesMatch>

  <FilesMatch ".(jpg|jpeg)$">
    # 1 week cache
    Header set Cache-Control "public, max-age=604800"
    Header set X-Content-Type-Options "nosniff"
    Header set Content-Type "image/jpeg; charset=UTF-8"

  </FilesMatch>

  <FilesMatch ".png$">
    # 1 week cache
    Header set Cache-Control "public, max-age=604800"
    Header set X-Content-Type-Options "nosniff"
    Header set Content-Type "image/png; charset=UTF-8"

  </FilesMatch>

  <FilesMatch ".gif$">
    # 1 week cache
    Header set Cache-Control "public, max-age=604800"
    Header set X-Content-Type-Options "nosniff"
    Header set Content-Type "image/gif; charset=UTF-8"
  </FilesMatch>
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType application/javascript A172800
  ExpiresByType text/css A172800
  ExpiresByType image/gif A604800
  ExpiresByType image/png A604800
  ExpiresByType image/jpeg A604800
</IfModule>

# we'll handle the errors, thanks
# (yes, the 403 page will say 404, nobody really cares though)
ErrorDocument 403 index.php?page=error
ErrorDocument 404 index.php?page=error

# no page indexes!
Options -Indexes

#
###############################################################################
# To enable rewriting, please uncomment the lines below
# (remove the # at the beginning of each line)
###############################################################################
#

#<IfModule mod_rewrite.c>
#  # let us know in-script that mod rewrite is in use
#  SetEnv HTTP_USING_MOD_REWRITE On
#
#  # enable mod_rewrite!
#  RewriteEngine On
#
#   ####
#  # CHANGE THIS LINE TO YOUR SITE BASE PATH
#   ####
#  RewriteBase /tf2stats
#
#  RewriteCond %{REQUEST_FILENAME} !-f
#  RewriteCond %{REQUEST_FILENAME} !-d
#  RewriteRule . index.php [L]
#
#  # change the error documents accordingly
#  ErrorDocument 403 /error/
#  ErrorDocument 404 /error/
#</IfModule>

On Github License

Files

Download PDF of Htaccess file
REQUEST_FILENAME

Comments

Apache