-1

I was looking around for a decent solution to preventing any user who uses internet explorer 7 and below from accessing my website. I found none so far. Due to the fact that I'm new to this aspect.

I have Nginx web server on my VPS where my website is, but not sure of any good way to disable internet explorer 7 and below. I was thinking of Javascript way, but didn't find anything...

can anyone lead me to a good start or a direct solution to this!!

Thanks,

Digital site
  • 4,431
  • 12
  • 48
  • 72
  • I know that, but spammers do and very much. This is a big reason why!! – Digital site May 10 '14 at 10:19
  • You mean redirect them? – ale May 10 '14 at 10:19
  • at least stopping them from continuing to enter my website. or a warning message telling them to use high version of ie such as 8, 9 and so on or user another modern browser like Chrome or FF – Digital site May 10 '14 at 10:21
  • location / { if ($http_user_agent ~* '(MSIE 6.0|MSIE 7.0)') { return 301 https://$host$request_uri; } } – ale May 10 '14 at 10:22
  • This question appears to belong on another site in the Stack Exchange network because its not about programming. Perhaps [Super User](https://www.superuser.com/) or [Server Fault](http://serverfault.com/). – jww May 11 '14 at 11:31

2 Answers2

1

HTML 5 Boilerplate uses conditional comments to print a message if a user uses some version of IE.

<!--[if lt IE 8]>
    <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

Reference about conditional comments

Vucko
  • 20,555
  • 10
  • 56
  • 107
0

Sorry my previous answer misread the question. This question has been asked before. You can see a great answer here:

https://stackoverflow.com/a/10965091/2338488

Create a class with the ie type:

<!doctype html>
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->
<head>

then write a check

(function ($) {
    "use strict";

    // Detecting IE
    var oldIE;
    if ($('html').is('.ie6, .ie7)) {
        oldIE = true;
    }

    if (oldIE) {
        //redirect to chrome installer
        window.location.replace("http://www.google.com/intl/en_au/chrome/browser/");
    } else {
        // ..And here's the full-fat code for everyone else
    }

}(jQuery));
Community
  • 1
  • 1
Cyassin
  • 1,437
  • 1
  • 15
  • 31
  • 3
    if you want to report a duplicate, click "close" below question body and select "duplicate of" in the popup. – Ejaz May 10 '14 at 10:35
  • Thanks guys, taken both of your advices. To whoever is -1 every answer, can you please provide feedback. Would be useful.... – Cyassin May 10 '14 at 11:00