joaomak/dajogo/master/.htaccess - Htaccess File

joaomak/dajogo/master/.htaccess

# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html

# Techniques in here adapted from all over, 
#   including Kroc Camen: camendesign.com/.htaccess

AddType 'text/html; charset=ISO-8859-1' html
#AddType application/x-httpd-php .js 

# Force the latest IE version, in various cases when it may fall back to IE7 mode
#  github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    BrowserMatch MSIE ie
    Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
  </IfModule>
</IfModule>

# video
AddType video/ogg  ogg ogv
AddType video/mp4  mp4
AddType video/webm webm

# Proper svg serving. Required for svg webfonts on iPad
#   twitter.com/FontSquirrel/status/14855840545
AddType image/svg+xml                 svg svgz 

# webfonts
AddType application/vnd.ms-fontobject eot
AddType font/ttf                      ttf
AddType font/otf                      otf
AddType font/x-woff                   woff

AddType text/cache-manifest           manifest

# gzip compression.
<IfModule mod_deflate.c>

# html, xml, css, and js:
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json 

# webfonts and svg:
  <FilesMatch ".(ttf|otf|eot|svg)$" >
    SetOutputFilter DEFLATE
  </FilesMatch>
</IfModule>

# EXPIRES CACHING 
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 hour"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month" 
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/x-shockwave-flash "access 2 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>

RewriteEngine On
#RewriteBase /jm/dajogo/app/www/
Options -Indexes

#ErrorDocument 404 index.html?pg=404  [R]

DirectoryIndex index.html

RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]

# RewriteCond %{HTTP_HOST} !^www..*
# RewriteCond %{HTTP_HOST} !^$
# RewriteCond %{HTTP_HOST} ^([^.]*).(com.br|com.br/)
# RewriteRule ^.*$ http://www.%1.%2%{REQUEST_URI} [R=301,L]

# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{REQUEST_FILENAME} !-l
# RewriteRule ^(.+).html$ ?pg=$1    [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+).xml$ feed.php?pg=$1      [R]

# PAGINAS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^grupos/novo$ ?pg=grupos-novo    [R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^grupo/(.+)$ ?pg=grupo&gid=$1    [R]

RewriteRule ^confirmar/(.+)$ ?pg=confirmar&crypt=$1    [R]
RewriteRule ^desconfirmar/(.+)$ ?pg=desconfirmar&crypt=$1    [R]

RewriteRule ^a/(.+)$ ?a=$1    [R]
RewriteRule ^evento/novo/(.+)$ ?pg=evento-novo&gid=$1    [R]
RewriteRule ^evento/edita/(.+)$ ?pg=evento-edita&gid=$1    [R]
RewriteRule ^evento/(.+)$ ?pg=evento&gid=$1    [R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^e/(.+)$ ?pg=evento&crypt=$1    [R]

On Github License

Files

Download PDF of Htaccess file
DEFLATE, HTTP_HOST, REQUEST_FILENAME, REQUEST_METHOD, REQUEST_URI

Comments

Apache