cnlpete/candybox/release/5.0/.htaccess - Htaccess File


# Many rules are taken from

# Add PHP5 support at
#AddHandler php53-cgi .php

# Hide files for non script access
<FilesMatch ".(sql|gz|tpl|mob|ini|yml|php|log|less)$">
  order allow,deny
  deny from all

<Files index.php>
  Allow from all

Options +FollowSymLinks
RewriteEngine On

# redirect existing files and symbolic links
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule ^.*$ - [NC,L]

# rewrite install folder
RewriteRule install - [NC,L]
RewriteRule upload - [NC,L]

# rewrite all other calls to our index.php
RewriteRule ^.*$ index.php [NC,L]

# Force the latest IE version, in various cases when it may fall back to IE7 mode
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    BrowserMatch MSIE ie
    Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie

# Cache files
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault A0

  # 1 YEAR
  <FilesMatch ".(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
    ExpiresDefault A9030400

  # 1 WEEK
  <FilesMatch ".(jpg|jpeg|png|gif|swf)$">
    ExpiresDefault A604800

  # 3 HOUR
  <FilesMatch ".(txt|xml|js|css)$">
    ExpiresDefault A604800

  # Microsoft icon support
  AddType image/ .ico
  ExpiresByType image/ "access plus 3 months"

<ifModule mod_headers.c>
  # 1 YEAR
  <FilesMatch ".(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
    Header set Cache-Control "max-age=29030400, public"

  # 1 WEEK
  <FilesMatch ".(jpg|jpeg|png|gif|swf)$">
    Header set Cache-Control "max-age=604800, public"

  # 5 HOUR
  <FilesMatch ".(txt|xml|js|css)$">
    Header set Cache-Control "max-age=604800"

  <FilesMatch ".(html|htm|php|cgi|pl|less)$">
    Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"

  # Disabled. Uncomment to serve cross-domain ajax requests
  Header set Access-Control-Allow-Origin "*"

# Use gzip to compress data stream
<IfModule mod_deflate.c>
 AddOutputFilterByType DEFLATE text/html text/plain text/css application/x-javascript text/javascript application/javascript application/json text/xml application/xml text/x-component

<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

# Since we're sending far-future expires, we don't need ETags for static content.
FileETag None

# Add modern filetypes
# video
AddType video/ogg  ogg ogv
AddType video/mp4  mp4
AddType video/webm webm

# Proper svg serving. Required for svg webfonts on iPad
AddType image/svg+xml                 svg svgz

# webfonts
AddType application/ eot
AddType font/ttf                      ttf
AddType font/otf                      otf
AddType font/x-woff                   woff

ServerSignature Off

On Github License


Download PDF of Htaccess file