robinsk/zym/master/demo/web/.htaccess - Htaccess File

robinsk/zym/master/demo/web/.htaccess

### Server defaults
ServerSignature Off
 
### Default file types
AddType application/x-shockwave-flash .swf
AddType image/x-icon .ico
AddType video/x-flv .flv
 
# Default charset
AddDefaultCharset UTF-8

# Language to file mapping
#AddLanguage en-US .html .htm .txt .xml .php
 
# Server timezone
#SetEnv TZ GMT

# Server admin contact
#SetEnv SERVER_ADMIN webmaster@localhost

# Prevent directory listing
IndexIgnore *

# Follow symbolic links
Options +FollowSymLinks

# Disable access to .htaccess & .htpasswd
<Files ~ "^.ht">
  Order allow,deny
  Deny from all
</Files>

### PHP settings
<IfModule mod_php5.c>
    # Register globals
    php_flag register_globals off

    # Magic quotes
    php_flag magic_quotes_gpc off

    # Session auto starting
    php_flag session.autostart off

    # Short open tags
    php_flag short_open_tag on
</IfModule>

### Mod rewrite configuration
<IfModule mod_rewrite.c>
  # URL Rewriting
  RewriteEngine on

  # Rewrite base
  # RewriteBase /
  
    # Rewrite urls to index.php
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -l [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [NC,L]
  
  RewriteRule ^(.*)$ index.php/$1 [NC,L]
</IfModule>

### Output compression
<IfModule mod_deflate.c>
    # Always compress html content
    AddOutputFilterByType DEFLATE text/html
    
    # Set output filter on these file extensions
  <FilesMatch ".(js|css|txt|xml|json)$">
    SetOutputFilter DEFLATE
  </FilesMatch>
  
    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    # BrowserMatch bMSIE !no-gzip !gzip-only-text/html

    # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
    # the above regex won't work. You can use the following
    # workaround to get the desired effect:
    BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
    
    # Make sure proxies don't deliver the wrong content
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
</IfModule>

### Browser Caching

# TIME CHEAT SHEET
#      300   5 MIN
#      600  10 MIN
#      900  15 MIN
#     1800  30 MIN
#     2700  45 MIN
#
#     3600   1 HR
#     7200   2 HR
#    10800   3 HR
#    18000   5 HR
#    43200  12 HR
#    86400  24 HR
#
#    86400   1 DAY
#   172800   2 DAY
#   259200   3 DAY
#   604800   7 DAY
#
#   604800   1 WEEK
#  1209600   2 WEEK
#  1814400   3 WEEK
#
#  2419200   1 MONTH
#  4838400   2 MONTH
#  7257600   3 MONTH
# 14515200   6 MONTH
# 29030400  12 MONTH

# any Expires Directives go here
<IfModule mod_expires.c>
    #ExpiresActive On
    #ExpiresDefault A3600        
    #ExpiresByType application/x-javascript       A3600
    #ExpiresByType application/x-shockwave-flash  A3600
    #ExpiresByType text/css                       A3600
    #ExpiresByType image/x-icon                   A3600
    #ExpiresByType image/gif                      A3600
    #ExpiresByType image/png                      A3600
    #ExpiresByType image/jpeg                     A3600
    #ExpiresByType text/plain                     A3600
    #ExpiresByType video/x-flv                    A3600
</IfModule>

# any Header directives go here
<IfModule mod_headers.c>
    # Safely cache for 1 hour
    #<FilesMatch ".(ico|png|gif|jpg|jpeg|js|css)$">
    #    Header set Cache-Control "max-age=3600, private, proxy-revalidate"
    #</FilesMatch>
</IfModule>

# Disable E-Tags
FileETag none

On Github License

Files

Download PDF of Htaccess file
DEFLATE, no-gzip, REQUEST_FILENAME, SERVER_ADMIN, TIME, TZ

Comments

Apache