How to block internet explorer access?

Asked

Viewed 112 times

3

How can I block my site from being accessed by Iternet explorer via . htaccess? I’ve tried codes like:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} "MSIE [6-8]" [NC]
RewriteRule ^(.*)$ http://mysite.com/ie [R=301,L]

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} *MSIE*
RewriteRule ^index\.html$ http://example.com/ie/ [L]
RewriteRule  ^/$ http://example.com/index.html [L]
</IfModule>

But it didn’t work, someone knows some other code that works?

1 answer

0

Use like this:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} "MSIE [6-8]" [NC]
RewriteRule ^(.*)$ http://mysite.com/ie [R=301,L]

It will redirect to http://mysite.com/ie, where you can put some message informing the user. Leave that part alone, in the "MSIE [6-8]" part is the IE version.

  • I tested here in XAMPP gave Internal Server Error, put with MSIE [10-12] does not give the error, but also does not "block".

  • Check the apache configuration file to see if the Allowoverride variable is ALL, and instead of "MSIE [6-8]" [NC] puts *MSIE*

  • Yes, in the option <Directory "C:/xampp/htdocs"> is as AllowOverride All

  • kkkk now Chrome is redirecting, but IE remains the same. : P

  • I used that code and it didn’t work :(.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.