Superbeest/Core/master/core4/system/install/.htaccess - Htaccess File

Superbeest/Core/master/core4/system/install/.htaccess

Options +FollowSymlinks
RewriteEngine on

# Increase cookie security
<IfModule php5_module>
  php_value session.cookie_httponly true
</IfModule>

# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8

# Force UTF-8 for a number of file formats
AddCharset utf-8 .html .css .js .xml .json .rss

##########################################################################################
# Better website experience for IE users                                                 #
##########################################################################################

# Force the latest IE version, in various cases when it may fall back to IE7 mode
#  github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk

<IfModule mod_headers.c>
  Header set X-UA-Compatible "IE=Edge,chrome=1"
  # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
  <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)                                                     #
##########################################################################################

# Send CORS headers if browsers request them; enabled by default for images.
# developer.mozilla.org/en/CORS_Enabled_Image
# blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
# hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
# wiki.mozilla.org/Security/Reviews/crossoriginAttribute

<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>

##########################################################################################
# Proper MIME type for all files                                                         #
##########################################################################################

# JavaScript
#   Normalize to standard type (it's sniffed in IE anyways)
#   tools.ietf.org/html/rfc4329#section-7.2
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
#   Required for svg webfonts on iPad
#   twitter.com/FontSquirrel/status/14855840545
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>

  # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
  <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>

  # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
  <IfVersion < 2.4.4>
    <IfModule filter_module>
    FilterDeclare   COMPRESS
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/css
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/plain
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/x-component
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/javascript
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/json
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xhtml+xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/rss+xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/atom+xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/vnd.ms-fontobject
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/svg+xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/x-icon
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/x-font-ttf
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
    FilterChain     COMPRESS
    FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
    </IfModule>
  </IfVersion>
  <IfVersion >= 2.4.4>
    <IfModule filter_module>
    FilterDeclare   COMPRESS
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'text/html'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'text/css'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'text/plain'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'text/xml'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'text/x-component'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'application/javascript'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'application/json'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'application/xml'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'application/xhtml+xml'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'application/rss+xml'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'application/atom+xml'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'application/vnd.ms-fontobject'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'image/svg+xml'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'image/x-icon'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'application/x-font-ttf'"
    FilterProvider  COMPRESS  DEFLATE "%{Content_Type} = 'font/opentype'"
    FilterChain     COMPRESS
    FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
    </IfModule>
  </IfVersion>

  <IfModule !mod_filter.c>
  # Legacy versions of Apache
  AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
  AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
  AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
  </IfModule>
</IfModule>

##########################################################################################
# ETag removal                                                                           #
##########################################################################################

# FileETag None is not enough for every server.
<IfModule mod_headers.c>
  Header unset ETag
</IfModule>

# Since we're sending far-future expires, we don't need ETags for
# static content.
#   developer.yahoo.com/performance/rules.html#etags
FileETag None

##########################################################################################
# Prevent 404 errors for non-existing redirected folders                                 #
##########################################################################################

# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
#   e.g. /blog/hello : webmasterworld.com/apache/3808792.htm

Options -MultiViews

ExpiresActive On
ExpiresDefault                                  "now"
ExpiresByType text/html                         "now"
ExpiresByType text/xml                          "now"
ExpiresByType text/plain                        "access plus 1 month"
ExpiresByType text/css                          "access plus 1 month"
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 application/x-shockwave-flash     "access plus 1 month"
ExpiresByType image/x-icon                      "access plus 1 month"
ExpiresByType video/x-flv                       "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"

# "-Indexes" will have Apache block users from browsing folders without a default document
# Usually you should leave this activated, because you shouldn't allow everybody to surf through
# every folder on your server (which includes rather private places like CMS system folders).
<IfModule mod_autoindex.c>
  Options -Indexes
</IfModule>

# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or Git.
<IfModule mod_rewrite.c>
  RewriteCond %{SCRIPT_FILENAME} -d
  RewriteCond %{SCRIPT_FILENAME} -f
  RewriteRule "(^|/)." - [F]
</IfModule>

##########################################################################################
# SYSTEM DEFAULT RULES                                                                   #
##########################################################################################

# Make sure no harmfull other files can be accessed.
RewriteCond %{REQUEST_FILENAME} !(.+)/robots.txt
RewriteRule ^(.*)(.(php|xsl|dtd|xml|ttf|html|htm|txt|exe|rar|zip|7zip|tar|gz))(.*)$ index.php [L]

# Modulecontroller rewrite rules
RewriteRule ^([a-zA-Z-_]+)/([a-zA-Z-_]+)/([a-zA-Z-_]+)/([1-9][0-9]*)/?$ index.php?mod=$1&controller=$2&action=$3&id=$4&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z-_]+)/([a-zA-Z-_]+)/([a-zA-Z-_]+)/?$ index.php?mod=$1&controller=$2&action=$3&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z-_]+)/([a-zA-Z-_]+)/([1-9][0-9]*)/?$ index.php?controller=$1&action=$2&id=$3&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z-_]+)/([a-zA-Z-_]+)/?$ index.php?controller=$1&action=$2&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z-_]+)/([1-9][0-9]*)/?$ index.php?controller=$1&id=$2&%{QUERY_STRING} [L]
RewriteRule ^([a-zA-Z-_]+)/?$ index.php?controller=$1&%{QUERY_STRING} [L]
RewriteRule ^([1-9][0-9]*)/?$ index.php?id=$1&%{QUERY_STRING} [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php

On Github License

Files

Download PDF of Htaccess file
DEFLATE, QUERY_STRING, REQUEST_FILENAME, SCRIPT_FILENAME, static

Comments

Apache