kazinduzi/kazinduzi/master/example.htaccess - Htaccess File

kazinduzi/kazinduzi/master/example.htaccess

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
    php_flag magic_quotes_gpc                 off
    php_flag magic_quotes_sybase              off
    php_flag register_globals                 off
    php_flag session.auto_start               off
    php_value mbstring.http_input             pass
    php_value mbstring.http_output            pass
    php_flag mbstring.encoding_translation    off
    php_value upload_max_filesize             10M
    php_value post_max_size                   10M
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    SetEnv APPLICATION_ENV "development"
    # Rewrite all module based assets
    RewriteRule ^_assets/module/(.*)/(images|css|javascript|js)/(.*) /application/modules/$1/assets/$2/$3 [L,QSA]
    # Rewrite all module based assets
    RewriteRule ^_themes/(.*)/(images|img|css|javascript|js)/(.*) /application/themes/$1/$2/$3 [L,QSA]
    # Protect accessing our most important
    RewriteCond $1 !^(index.php|database|core|elements|helpers|includes|library|application|robots.txt)

    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L,QSA]
</IfModule>

AddDefaultCharset utf-8

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

  # Compress all output labeled with one of the following MIME-types
  # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
  # and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines as
  # `AddOutputFilterByType` is still in the core directives)
  #<IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE application/atom+xml 
                                  application/javascript 
                                  application/json 
                                  application/rss+xml 
                                  application/vnd.ms-fontobject 
                                  application/x-font-ttf 
                                  application/xhtml+xml 
                                  application/xml 
                                  font/opentype 
                                  image/svg+xml 
                                  image/x-icon 
                                  text/css 
                                  text/html 
                                  text/plain 
                                  text/x-component 
                                  text/xml
  #</IfModule>
</IfModule>
<IfModule mod_expires.c>
    ExpiresActive On
    <FilesMatch ".(jpg|jpeg|png|gif|svg)$">
        ExpiresDefault "access plus 1 month"
    </FilesMatch> 
</IfModule>
ErrorDocument 500 "<h2>Apache server error</h2>Kazinduzi application failed to start properly"

On Github License

Files

Download PDF of Htaccess file
DEFLATE, ENV, REQUEST_FILENAME

Comments

Apache