ebmarques/itemsys/master/.htaccess - Htaccess File

ebmarques/itemsys/master/.htaccess

#-> Item-System Requirements
################################################################################
#php_flag register_globals off #-> HOSTGATOR CRASHED WITH THIS
#php_flag magic_quotes_gpc off #-> HOSTGATOR CRASHED WITH THIS
#php_value session.use_trans_sid 0 #-> HOSTGATOR CRASHED WITH THIS
AddDefaultCharset UTF-8

#-> If uncommenting following line produces erors, keep it commented
# Options +FollowSymLinks
# Options -Indexes

#-> Attention GoDaddy users: In order to remove the extensions you need to
#   enable MultiViews first. The code should look like this:
#   Options -MultiViews

#-> For the ones worried that search engines might index some pages as duplicate
#   content, take a look at the canonical meta tag in your HTML head

#-> Rewrites
################################################################################
<IfModule mod_rewrite.c>

  #Options +FollowSymlinks # Uncomment if your server allow you to have it
  RewriteEngine on

  #-> Only allow GET and POST Request Methods
  #RewriteCond %{REQUEST_METHOD} !^(GET|POST)
  #RewriteRule .* - [F]

  #-> If you have installed Item-System in a sub-folder then set this path properly
  #RewriteBase /relative/web/path/

  #-> Redirect www.YOURDOMAINNAME.com to YOURDOMAINNAME.com (but not local installation)
  #RewriteCond %{HTTP_HOST} !^YOURDOMAINNAME.com$ [NC]
  #RewriteCond %{REMOTE_ADDR} !^127.0.0.1
  #RewriteRule ^(.*)$ http://YOURDOMAINNAME.com/$1 [R=301,L]

  #-> Change URL suffix to .html
  RewriteRule .*.html$ index.php [NC]

  #-> Testing:
  #RewriteRule ^(ar|br|cs|de|el|en|es|fi|fr|hr|hu|it|lt|nl|pl|pt|ru|sv|tr)/([a-z]+)/([a-z]+) index.php?lng=$1&action=$2&id=$3 [NC]
  #RewriteRule ^(ar|br|cs|de|el|en|es|fi|fr|hr|hu|it|lt|nl|pl|pt|ru|sv|tr)/([a-z]+)/([0-9]+) index.php?lng=$1&action=$2&id=$3 [NC]
  #RewriteRule ^(ar|br|cs|de|el|en|es|fi|fr|hr|hu|it|lt|nl|pl|pt|ru|sv|tr)/([a-z]+)          index.php?lng=$1&action=$2 [NC]
  #RewriteRule ^(ar|br|cs|de|el|en|es|fi|fr|hr|hu|it|lt|nl|pl|pt|ru|sv|tr)                   index.php?lng=$1 [NC]
  #-> Much Better:
  RewriteRule ^([a-z]{2})/([a-z]+)/([a-z]+) index.php?lng=$1&action=$2&id=$3 [NC]
  RewriteRule ^([a-z]{2})/([a-z]+)/([0-9]+) index.php?lng=$1&action=$2&id=$3 [NC]
  RewriteRule ^([a-z]{2})/([a-z]+)          index.php?lng=$1&action=$2 [NC]
  RewriteRule ^([a-z]{2})/?$                index.php?lng=$1 [NC]
  RewriteRule ^([a-z]+)/([a-z]+)            index.php?action=$1&id=$2 [NC]
  RewriteRule ^([a-z]+)/([0-9]+)            index.php?action=$1&id=$2 [NC]
  RewriteRule ^([a-z]+)/                    index.php?action=$1 [NC]

  #-> Stop browser prefetching
  SetEnvIfNoCase X-Forwarded-For .+ proxy=yes
  SetEnvIfNoCase X-moz prefetch no_access=yes
  # block pre-fetch requests with X-moz headers
  RewriteCond %{ENV:no_access} yes
  RewriteRule .* - [F,L]

</IfModule>

#-> Error pages (set the path properly)
################################################################################
ErrorDocument 401 /is_errors/401.php
ErrorDocument 403 /is_errors/403.php
ErrorDocument 404 /is_errors/404.php
ErrorDocument 406 /is_errors/406.php
ErrorDocument 500 /is_errors/500.php

#-> http://developer.yahoo.com/performance/rules.html
#-> If your wish, an online test: http://www.gidnetwork.com/tools/gzip-test.php
################################################################################
#-> Apache need to have mod_expires enabled - So set expires headers
#-> Wish to know more? http://www.mnot.net/cache_docs/
<IfModule mod_expires.c>
  #-> Turn on expires and set default to A0
  ExpiresActive On
  ExpiresDefault A0
  Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
  Header set Pragma "no-cache
  <FilesMatch ".(htm|html)$">
    #-> 3 minutes
    ExpiresDefault "access plus 3 minutes"
    Header append Cache-Control "proxy-revalidate"
  </FilesMatch>
  <FilesMatch ".(css|js|php|txt|xml)$">
    #-> 3 minutes
    ExpiresDefault "access plus 3 days"
    Header append Cache-Control "proxy-revalidate"
  </FilesMatch>
  <FilesMatch ".(gif|ico|jpg|jpeg|png|swf)$">
    #-> 3 days
    ExpiresDefault "access plus 1 week"
    Header append Cache-Control "public"
  </FilesMatch>
</IfModule>

#-> Apache comes standard with the mod_deflate module...
#-> http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
<IfModule mod_deflate.c>
  SetOutputFilter DEFLATE
  #-> Properly handle old browsers that do not support compression
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4.0[678] no-gzip
  BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
  #-> Compress:
  AddOutputFilter DEFLATE text/html text/plain text/css text/javascript text/xml image/svg+xml application/javascript application/x-javascript application/atom_xml application/rss+xml application/xml ap$
  #-> Do not compress:
  SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$  no-gzip dont-vary
  SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
  #-> Uncomment if you use any:
  #SetEnvIfNoCase Request_URI .asf$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .asx$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .avi$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .mcf$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .mov$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .mpg$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .mp2$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .mp3$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .mp4$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .pls$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .rm$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .swf$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .wav$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .wax$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .wm$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .wma$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .wmd$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .wmv$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .wmz$ no-gzip dont-vary
  #SetEnvIfNoCase Request_URI .wmx$ no-gzip dont-vary
  #Make sure proxies don't deliver the wrong content
  Header append Vary User-Agent env=!dont-vary
</IfModule>

#-> Apache need to have mod_headers enabled - So unset Etags
<IfModule mod_headers.c>
  #ServerAdmin SOMETHING@YOURDOMAIN.COM
  #ServerName YOURDOMAIN.COM
  #ServerAlias www.YOURDOMAIN.COM
  #DocumentRoot /var/www
  Header unset ETag
  FileETag None
</IfModule>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, ENV, GET, HTTP_HOST, no-cache, no-gzip, POST, Pragma, REMOTE_ADDR, REQUEST_METHOD, REQUEST_URI

Comments

Apache