The Internet Explorer Landing Page is JavaScript-free. It does not use ActiveX. It does not use server-side scripting either. It is just a static web page. You get exactly the same page, regardless of whether you a web browser or any version of Internet Explorer.
The trick is that Internet Explorer does not process web pages the same way that web browsers do.
I’d like to show the main site home page (index.xhtml), but
Internet Explorer 8 and earlier cannot handle it. That’s why visitors
using these older versions of Internet Explorer should land on the Internet Explorer Landing page.
However, visitors using a real web browser should not have to land there every time they visit the site. So the trick is to make sure visitors using a web browser end up on the home
page, while visitors using Internet Explorer 8 and earlier end up on the Internet Explorer landing page.
When you visit the site you will see either of two pages. Visitors using a web browser will see the home page, visitors using Internet Explorer 8 and earlier will see the Internet Explorer Landing page. Both are perfectly normal web pages.
The trick is not in those pages, but in another page, the Internet Explorer Decision Page. It is actually the first page every visitor gets to see. It is a small page that loads quickly and immediately instructs the browser to load either the home page or the Internet Explorer Landing Page.
I used a delay of a few second while developing the page, but the current delay is zero. This page is so small and most browsers are so fast that you will hardly notice this page, the browser just seems to load the right page as if by magic. That magic happens in that first page. You should never have to see that page, but it contains clickable links just in case.
The decision page contains no information, it just redirects the browser to
either the home page or the Internet Explorer Landing page. The home page and
Internet Explorer Landing Page themselves do not contain any redirect
instructions at all.
You can choose to visit either page using either a web browser or an old version of Internet Explorer and will not be redirected to the other page. This allows users of real browsers to visit the Internet Explorer Mini Site and users who have applied the quick fix to
old versions of Internet Explorer to visit the main site using
that old version Internet Explorer.
Only when you visit the web site without specifying a page, will
your browser select either the home page or the Internet Explorer Landing Page for you.
The Internet Explorer Decision Page is an incredibly boring page, but if you
are very curious, you can view it at your leisure by blocking the
page refresh.
Many browser have an option to do so. For example, Firefox, you can do so by enabling the
"Warn me when web sites try to redirect or reload the page" option on the
General tab of the Advanced Options. You can even leave this warning enabled
without having to explicitly allow the redirection every time, just add the site’s home page to your bookmarks
and always use that direct link to bypass the Internet Explorer Decision Page.
The decision which page to show is not made by the web site, but by your browser. The web site has merely been set up so that the browser will start by loading the decision page. Once the decision page is loaded, the browser will decide which page to load next. Web browsers will decide to load the home page, Internet Explorer 8 and earlier will decide to load the Internet Explorer Landing Page.
The automatic decision relies on Internet Explorer-specific behaviour, known as
conditional comments.
Internet Explorer allows the use of conditions in web pages. These conditions are not part of any web standard, but by hiding the conditions in comments, real web browses won’t even notice their presence.
Most web browsers will simply ignore the comments, while Internet Explorer will act upon them.
The main site’s home
page is index.xhtml. If the Internet Explorer mini-site wasn’t here, the web
server would show you that page. If you browse directly to that page, the web server
will show you that page.
If you browse to the site without
specifying a page, the server will try to find the home page. Web servers
have a brief list of page names they look for. The filename index.xhtml is in that list, so when it
sees that page, it will show it to you to - and stop searching.
There are many more file names in that list. One of these is index.htm (without
x or l).
There is no official search order for these names, and webmasters can change the order.
Typically, index.htm comes before index.xhtml.
On this web server, index.htm comes before index.xhtml.
So, when the server sees index.htm,
it will stop looking for a matching file and just show index.htm instead of index.xhtml.
Thus every visitor lands on index.htm,
simply because the web server has deliberate been led to think it is the home page.
The web server may think it is the home page, but it is actually the Internet Explorer Decision Page. All it does is prompt the browser to make a decision; the browser chooses between a redirect to either the actual home page (index.xhtml) or
the Internet Explorer Landing Page (InternetExplorerLandingPage.html).
Redirection is done with a refresh command in the page header. This is what it looks like
<meta HTTP-EQUIV="refresh" content="0; url=index.xhtml" />
The meta HTTP-EQUIV part tells the browser that what follows is an HTTP
command, and then tells it to refresh the page by loading index.xhtml,
and to wait 0 seconds before doing it, i.e. to refresh immediately.
This particular method of redirecting is known as a meta refresh.
It is a deprecated method, but also the only method that relies on web standards
exclusively, and not the particulars of any web server.
Its usage has been limited to just one page in
such way that visitors can bypass it; if you want to bypass
the Internet Explorer Decision Page, just add the real home page to your favourites and visit it directly.
The right page is selected by combining Internet Explorer's conditional comments with two different refresh commands. Before Microsoft introduced Internet Explorer 9, it looked liked this.
<!--[if IE]> <![if !IE]> <![endif]-->
<meta http-equiv="refresh" content="0; url=index.xhtml" />
<!--[if IE]> <![endif]> <![endif]-->
<!--[if IE]>
<meta http-equiv="refresh" content="0; url=InternetExplorerLandingPage.html" />
<![endif]-->
The first command tells web browsers to switch to index.xhtml, but
because it is inside a conditional comment that says it is not for Internet
Explorer, Internet Explorer will ignore it. The second command is for Internet
Explorer, and because it is inside a comment, web browsers will ignore it.The condition for the browser case looks considerably more complex than the one for the Internet Explorer case; Valid Internet Explorer Conditional Comments explains why this is so. All that matters here is that it works.
Unlike preceding versions, Internet Explorer version 9 does support all major standards. Internet Explorer version 9 is a web browser, and users of version 9 or later need not be redirected to the Internet Explorer Mini Site. Therefore, the code on the Internet Explorer Decision Page now looks like this:
<!--[if IE]> <![if !IE]> <![endif]-->
<meta http-equiv="refresh" content="0; url=index.xhtml" />
<!--[if IE]> <![endif]> <![endif]-->
<!--[if gte IE 9 ]>
<meta http-equiv="refresh" content="0; url=index.xhtml" />
/>
<![endif]-->
<!--[if lt IE 9 ]>
<meta http-equiv="refresh" content="0; url=InternetExplorerLandingPage.html" />
<![endif]-->
This technique can easily be expanded to cover additional Internet Explorer
versions.
It can even cover the case that Internet Explorer finally supports
the necessary web standards. If say Internet Explorer version 9 is finally up to web standards,
the Internet Explorer Decision Page can be updated to look like
this:
<!--[if IE]> <![if !IE]> <![endif]-->
<meta http-equiv="refresh" content="0; url=index.xhtml" />
<!--[if IE]> <![endif]> <![endif]-->
<!--[if gte IE 9]>
<meta http-equiv="refresh" content="0; url=index.xhtml" />
<![endif]-->
<!--[if lt IE 9]>
<meta http-equiv="refresh" content="0; url=InternetExplorerLandingPage.html" />
<![endif]-->
The conditional comments technique has one important limitation. Conditional comments were introduced with Internet Explorer 5, so Internet Explorer 4 and earlier do not support it. This limitation is a fairly theoretical issue, not only because almost no one uses Internet Explorer 4 anymore, but also because anyone who is still using it cannot help but be aware that this product from 1997 has serious limitations.