browser-update/browser-update/master/.htaccess - Htaccess File

browser-update/browser-update/master/.htaccess

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/new/?([a-zA-Z0-9_-]+).html$ $1.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/new/?([a-z]{2}(-[a-z]{2})?)/([a-zA-Z0-9_-]+).html$ $3.php?lang=$1 [L,QSA]

RewriteRule ^/new/?([a-z]{2}(-[a-z]{2})?)/$ index.php?lang=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?([a-z]{2}(-[a-z]{2})?)/update.html$ update-browser.php?lang=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?update.html$ update-browser.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?([a-zA-Z0-9_-]+).html$ $1.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?([a-z]{2}(-[a-z]{2})?)/([a-zA-Z0-9_-]+).html$ $3.php?lang=$1 [L,QSA]

RewriteRule ^/?([a-z]{2}(-[a-z]{2})?)/$ index.php?lang=$1 [L,QSA]

AddCharset utf-8 .js

#4 days cache for the files

<FilesMatch "update.js">
  Header set Cache-Control "public, max-age=86400"
  ExpiresDefault "access plus 1 day"
  SetOutputFilter DEFLATE
</FilesMatch>

<FilesMatch "update.min.js">
  Header set Cache-Control "public, max-age=86400"
  ExpiresDefault "access plus 1 day"
  SetOutputFilter DEFLATE
</FilesMatch>

#no cache
<FilesMatch "updatex.js">
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
  SetOutputFilter DEFLATE
</FilesMatch>

<FilesMatch ".png">
  Header set Cache-Control "public, max-age=864000"
</FilesMatch>

<FilesMatch "/new/">
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</FilesMatch>

On Github License

Files

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

Comments

Apache