Jerome1337/Parenthese/master/Website/app/.htaccess - Htaccess File

Jerome1337/Parenthese/master/Website/app/.htaccess

Options +FollowSymLinks -MultiViews

## Prevent viewing of .htaccess file
<Files .htaccess>
  order allow,deny
  deny from all
</Files>

##<IfModule mod_headers.c>
##  <FileMatch ".(js|css|xml|gz|html|php)$">
##    Header append Vary: Accept-Encoding
##  </FileMatch>
##</IfModule>

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.bicravart.com [NC]
RewriteRule ^(.*)$ http://bicravart.com/$1 [L,R=301]

## Hide .php extension
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s([^.]+).php [NC]
RewriteRule ^ %1 [R,L,NC]

## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(/$|.|^%) 
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]

## contrôle du cache navigateur - Expire headers
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 7200 seconds"
  ExpiresByType image/jpg       "access plus 1 week"
  ExpiresByType image/jpeg       "access plus 1 week"
  ExpiresByType image/png       "access plus 1 week"
  ExpiresByType image/gif       "access plus 1 week"
  ExpiresByType image/svg+xml      "access plus 1 week"
  AddType image/x-icon .ico
  ExpiresByType image/ico       "access plus 1 week"
  ExpiresByType image/icon       "access plus 1 week"
  ExpiresByType image/x-icon       "access plus 1 week"
  ExpiresByType text/css         "access plus 1 week"
  ExpiresByType text/javascript     "access plus 1 week"
  ExpiresByType text/html       "access plus 7200 seconds"
  ExpiresByType application/xhtml+xml   "access plus 7200 seconds"
  ExpiresByType application/javascript   "access plus 1 week"
  ExpiresByType application/x-javascript   "access plus 1 week"
  ExpiresByType application/x-shockwave-flash "access plus 1 week"
  ExpiresByType application/x-font-woff   "access plus 600 seconds"
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "\.(ico|jpe?g|png|gif|swf)$">
  Header set Cache-Control "max-age=2592000, public"
  </FilesMatch>

  <FilesMatch "\.(css)$">
  Header set Cache-Control "max-age=604800, public"
  </FilesMatch>

  <FilesMatch "\.(js)$">
  Header set Cache-Control "max-age=216000, private"
  </FilesMatch>

  <FilesMatch "\.(x?html?|php)$">
  Header set Cache-Control "max-age=600, private, must-revalidate"
  </FilesMatch>

  <FilesMatch "\.(woff)$">
  Header set Cache-Control "max-age=600, private, must-revalidate"
  </FilesMatch>
</IfModule>

On Github License

Files

Download PDF of Htaccess file
HTTP_HOST, REQUEST_FILENAME, REQUEST_URI, THE_REQUEST

Comments

Apache