greg-md/app/master/public/.htaccess - Htaccess File

greg-md/app/master/public/.htaccess

#Order Deny,Allow
#Deny from All
#Allow from 188.138.167.142

# Hide Server signature
ServerSignature Off

# Proper svg serving. Required for svg webfonts on iPad
# twitter.com/FontSquirrel/status/14855840545
AddType image/svg+xml svg svgz

AddEncoding gzip svgz

AddDefaultCharset utf-8

DefaultLanguage en-EN

AddCharset utf-8 .css .js .xml .json

IndexIgnore *

Options All -Indexes

DirectoryIndex index.php index.html

#LimitRequestBody 10240000 # Limit to 10M

<Files ~ "^(env(..+)?).php$">
    Order allow,deny
    Deny from all
</Files>

<Files ~ "^(nginx(-php)?.*).conf.*$">
    Order allow,deny
    Deny from all
</Files>

<IfModule mod_deflate.c>
    # html, txt, css, js, json, xml, htc:
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
    AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
    AddOutputFilterByType DEFLATE text/xml application/xml text/x-component

    # webfonts and svg:
    <FilesMatch ".(ttf|otf|eot|svg)$">
        SetOutputFilter DEFLATE
    </FilesMatch>
</IfModule>

<IfModule mod_expires.c>
    ExpiresActive On

    ExpiresByType application/x-javascript       "access 36000 seconds"
    ExpiresByType application/x-shockwave-flash  "access 36000 seconds"
    ExpiresByType application/pdf                "access 36000 seconds"
    ExpiresByType text/css                       "access 36000 seconds"
    ExpiresByType text/html                      "access 36000 seconds"
    ExpiresByType image/x-icon                   "access 36000 seconds"
    ExpiresByType image/gif                      "access 36000 seconds"
    ExpiresByType image/png                      "access 36000 seconds"
    ExpiresByType image/jpg                      "access 36000 seconds"
    ExpiresByType image/jpeg                     "access 36000 seconds"
    ExpiresByType text/plain                     "access 36000 seconds"
    ExpiresByType video/x-flv                    "access 36000 seconds"

    ExpiresDefault "access 36000 seconds"

    <FilesMatch ".(pl|php|cgi|spl|scgi|fcgi)$">
        ExpiresActive Off
    </FilesMatch>
</IfModule>

<IfModule mod_headers.c>
    # Because X-UA-Compatible isn't sent to non-IE (to save header bytes),
    # We need to inform proxies that content changes based on UA
    Header append Vary User-Agent

    # Safely cache for 10 hours
    <FilesMatch ".(css|txt|html?)$">
        Header unset Pragma
        #Header unset ETag
        Header set Cache-Control "max-age=36000"
        Header set Vary "Accept-Encoding"
    </FilesMatch>

    # Safely cache for 10 hours
    <FilesMatch ".(js)$">
        Header unset Pragma
        #Header unset ETag
        Header set Cache-Control "private, max-age=36000"
        Header set Vary "Accept-Encoding"
    </FilesMatch>

    # Safely cache for 10 hours
    <FilesMatch ".(flv|ico|png|jpe?g|gif|bmp|swf|pdf|woff|ttf|svg|eot|otf)$">
        Header unset Pragma
        #Header unset ETag
        Header set Cache-Control "max-age=36000"
        Header set Vary "Accept-Encoding"
    </FilesMatch>

    <FilesMatch ".(pl|php|cgi|spl|scgi|fcgi)$">
        Header unset Cache-Control
    </FilesMatch>

    <FilesMatch "image.php">
        Header unset Pragma
    </FilesMatch>

    # allow access from all domains for webfonts
    # alternatively you could only whitelist
    # your subdomains like "sub.domain.com"
    <FilesMatch ".(ttf|otf|eot|woff|font.css)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>

    # 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_setenvif.c>
        BrowserMatch MSIE ie
        Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
    </IfModule>
</IfModule>

<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 rspheader ^Content-Encoding:.*gzip.*
</IfModule>

<IfModule mod_rewrite.c>
    # URL Rewriting
    RewriteEngine on

    # limit server request methods to GET and PUT
    # Options -ExecCGI
    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)
    RewriteRule .* - [F]

    # www to non-www
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    # https www to non-www
    RewriteCond %{HTTPS} on
    RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

    # Fix for infinite loops
    RewriteCond %{ENV:REDIRECT_STATUS} 200
    RewriteRule .* - [L]

    # Exclude existent files or folders from rewriting
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule .* - [NC,L]

    # Image cache
    RewriteCond %{REQUEST_URI} @.+.(png|jpe?g|gif)$
    RewriteRule ^static(/.+) image.php?static=$1 [NC,L,QSA]

    # Exclude images from rewriting if they are not exists
    RewriteCond %{REQUEST_URI} !(.(png|jpe?g|gif|bmp|ico))$
    RewriteRule .+ index.php [NC,L,QSA]
</IfModule>

<IfModule mod_speling.c>
    CheckSpelling On
</IfModule>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, ENV, GET, HTTP_HOST, HTTPS, Pragma, PUT, REDIRECT_STATUS, REQUEST_FILENAME, REQUEST_METHOD, REQUEST_URI, static

Comments

Apache