fxaeberhard/RedCMS/master/.htaccess - Htaccess File

fxaeberhard/RedCMS/master/.htaccess

###################################################################OPTIONS DE L'INDEX
Options -Indexes
DirectoryIndex index.php

###################################################################We set error pages
#ERROR TARGETS
#ErrorDocument 404 /en/PageNotFound/

#php_flag display_errors on
#php_value error_reporting 1

### Enable directory like file structure
<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On
#  RewriteBase /RedCMS2/
  #RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f                  
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^.*$ index.php [L]
</IfModule>

### Set expiration with mod_expires
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg    "access plus 1 year"
  ExpiresByType image/jpeg   "access plus 1 year"
  ExpiresByType image/gif    "access plus 1 year"
  ExpiresByType image/png    "access plus 1 year"
  ExpiresByType audio/mpeg  "access plus 1 year"
  ExpiresByType application/x-shockwave-flash "access plus 1 year"
  ExpiresByType image/x-icon   "access plus 1 year"
  ExpiresByType text/plain  "access plus 1 year"
  ExpiresByType video/x-flv    "access plus 1 year"
  ExpiresByType application/pdf   "access plus 1 year"
  ExpiresByType application/x-javascript "access plus 1 year"
  ExpiresByType text/css     "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
  ### Enable Force download for some file types
  <FilesMatch ".(pdf|sql|doc|docx)$">
    Header set Content-Disposition "attachment"
    # for older browsers
    Header set Content-Type "application/octet-stream"
  </FilesMatch>

  ### Enable cache
  <FilesMatch ".(gif|GIF|JPE?G|PNG|jpe?g|png|ico|css|js|swf)$">
    Header set Cache-Control "public, max-age=290304000"
    Header unset Vary
  </FilesMatch>
</IfModule>

<IfModule mod_deflate.c>
  #SetOutputFilter DEFLATE
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
  #text/javascript application/javascript
</IfModule>

### Activate gzip if possible
<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_include mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  mod_gzip_item_exclude         file       .gz$
  mod_gzip_item_exclude         file       .zip$
</ifModule>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, GET, REQUEST_FILENAME

Comments

Apache