inspira2015/postalcodeMX/master/.htaccess - Htaccess File

inspira2015/postalcodeMX/master/.htaccess

RewriteEngine on
RewriteCond $1 !^(index.php|assets|robots.txt|zip_radius.php|zip_radius_ca.php)
RewriteRule ^(.*)$ /index.php/$1 [L]

<ifModule mod_headers.c>
  # Turn on Expires and set default expires to 3 days
  ExpiresActive On
  ExpiresDefault A259200
   
  # Set up caching on media files for 1 month
  <FilesMatch ".(ico|gif|jpg|jpeg|png|flv|pdf|swf|mov|mp3|wmv|ppt)$">
    ExpiresDefault A2419200
    Header append Cache-Control "public"
  </FilesMatch>
   
  # Set up 2 Hour caching on commonly updated files
  <FilesMatch ".(xml|txt|html|js|css)$">
    ExpiresDefault A7200
    Header append Cache-Control "private, must-revalidate"
  </FilesMatch>
   
  # Force no caching for dynamic files
  <FilesMatch ".(php|cgi|pl|htm)$">
    ExpiresDefault A0
    Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
    Header set Pragma "no-cache"
  </FilesMatch>
  
</ifModule>

<IfModule mod_deflate.c>   
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/x-javascript

  AddOutputFilterByType DEFLATE image/gif
  AddOutputFilterByType DEFLATE image/jpg
  AddOutputFilterByType DEFLATE image/jpeg
  AddOutputFilterByType DEFLATE image/png
  AddOutputFilterByType DEFLATE image/bmp
  
  #DeflateCompressionLevel 9
  
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4.0[678] no-gzip
  BrowserMatch bMSIE !no-gzip !gzip-only-text/html
</Ifmodule>

# STRONG HTACCESS PROTECTION
<Files ~ "^.*.([Hh][Tt][Aa])">
 order allow,deny
 deny from all
 satisfy all
</Files>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, no-cache, no-gzip, Pragma

Comments

Apache