iEFdev/browser-upgrade-page/master/_.htaccess - Htaccess File

iEFdev/browser-upgrade-page/master/_.htaccess

<Files ".ht*">
    Require all denied
</Files>

# No serverinfo
ServerSignature Off

Options All -Indexes +FollowSymLinks

# Using IE=edge & chrome=1 in the example
<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    BrowserMatch MSIE ie
    Header set X-UA-Compatible "IE=edge,chrome=1" env=ie
  </IfModule>
</IfModule>
<IfModule mod_headers.c>
  Header append Vary User-Agent
</IfModule>

# Redirecting IE <11 to a custom "upgrade page".
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} MSIE [5-9]
RewriteCond %{HTTP_USER_AGENT} MSIE [10]
# We allow IE11+ to pretend it's IE7..10 (eg F12 - dev/compat mode)
# Compat = Mozilla/4.0, IE11 = Trident/6+
RewriteCond %{HTTP_USER_AGENT} !(Mozilla/4).*(MSIE [7-9]).*(Trident/[6-7])
RewriteCond %{HTTP_USER_AGENT} !(Mozilla/4).*(MSIE [10]).*(Trident/[6-7])
RewriteCond %{REQUEST_URI} !/upgrade/
RewriteRule ^(.*)$ /upgrade/ [L]

On Github License

Files

Download PDF of Htaccess file
HTTP_USER_AGENT, REQUEST_URI

Comments

Apache