Danman
Danman

Reputation: 496

How do I redirect IE11 to Edge like Stack Overflow

When you navigate to https://stackoverflow.com in IE11, it redirects the user to Edge with the following tab open: https://support.microsoft.com/en-us/office/the-website-you-were-trying-to-reach-doesn-t-work-with-internet-explorer-8f5fc675-cd47-414c-9535-12821ddfc554?ui=en-us&rs=en-us&ad=us

How do I implement this in my own site? Is there a meta tag that can enable this?

EDIT: Here's a clip of what it looks like. Tried on Windows 10. https://streamable.com/nwtt22

Upvotes: 15

Views: 10575

Answers (6)

Kanaksinh Rahevar
Kanaksinh Rahevar

Reputation: 61

Need to add the below script in the head tag to redirect your website in Edge browser

<script>
   if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
      window.location = 'microsoft-edge:' + window.location;
      setTimeout(function() {
         window.open('', '_self', '').close();
         // window.location = 'https://support.microsoft.com/en-us/topic/we-recommend-viewing-this-website-in-microsoft-edge-160fa918-d581-4932-9e4e-1075c4713595?ui=en-us&rs=en-us&ad=us';            
      }, 0);
   }
</script>

Upvotes: 6

Sayem
Sayem

Reputation: 39

It's quite simple to add your domain to the redirection list.

https://learn.microsoft.com/en-us/microsoft-edge/web-platform/ie-to-microsoft-edge-redirection#request-an-update-to-the-ie-compatibility-list

https://learn.microsoft.com/en-us/deployedge/edge-learnmore-neededge

Request an update to the IE compatibility list The IE compatibility list is an XML file on microsoft.com. The list is regularly updated in response to user and website developer requests to have websites added or removed. Updates to the list are automatically downloaded to user machines.

Email the following information to [email protected] for your website to be added or removed from the IE compatibility list.

Owner name Corporate title Email address Company name Street address Website address

Upvotes: 3

Llamax
Llamax

Reputation: 337

I was wondering this too. After reading Joshua Joppie's answer, I did some Googling and found this webpage.

Turns out, you need to e-mail Microsoft to get your site added to the Edge-only list (how to do so is explained on that page). I'm not sure if they'll take a request from anyone, or whether you need to be a big website, like Stack Overflow. It's worth trying anyway, as the only requirement they give is this:

The IE compatibility list is designed to work with public sites only.

To be honest, I've no idea why they didn't just make a <meta> tag for it. It would be much easier.

If I have time (which I doubt), I plan to make a JS programme that mimics the functionality of a website's presence on this list and I will link to it here. You could always do a user agent check that redirects the user to microsoft-edge:https://example.com (where example.com is your website) if it detects them using Internet Explorer.

Upvotes: 7

Joshua Joppie
Joshua Joppie

Reputation: 101

Ah yes, I wondered this too, and also assumed to be a browser only thing.

Sure enough! It's the ie_to_edge_bho (Browser Helper Object) DLL file found in the Edge Program files.

I was curious enough to Hex edit the DLL file and found the URL in which it pulls these approved sites from... almost like a master/default list.

Yes, it's built into the BHO, no it's not stored locally from what I can tell. (Screenshot of Hex editor)

Here is the link: https://go.microsoft.com/fwlink/?linkid=2133855

Which forwards to https://edge.microsoft.com/neededge/v1

I have no idea how you get your own site on this list, but I figured I would add this information. :)

Upvotes: 10

user1413341
user1413341

Reputation: 226

I'm fairly certain that Microsoft checks its "Enterprise Mode Site List" in order to decide whether to open the webpage or direct users to Edge. You can find more information about it here: https://learn.microsoft.com/en-us/internet-explorer/ie11-deploy-guide/what-is-enterprise-mode

Upvotes: 2

Yu Zhou
Yu Zhou

Reputation: 13001

This is controlled by Edge Chromium group policy not code. You can refer to the steps below to set the group policy to achieve the goal:

1. Send all sites not included in the Enterprise Mode Site List to Microsoft Edge

This setting lets you decide whether to open all sites not included in the Enterprise Mode Site List in Microsoft Edge. If you use this setting, you must also turn on the Administrative Templates\Windows Components\Internet Explorer\Use the Enterprise Mode IE website list policy setting and you must include at least one site in the Enterprise Mode Site List.

  • Open Group Policy Editor.
  • Click Computer Configuration > Administrative Tools > Windows Components > Internet Explorer.
  • Double-click Send all sites not included in the Enterprise Mode Site List to Microsoft Edge.
  • Select Enabled.
  • Click OK or Apply to save these settings.

2. Configure which channel of Microsoft Edge to use for opening redirected sites

This policy enables you to configure up to three versions of Microsoft Edge to open a redirected site (in order of preference).

  • In the same path of Group Policy Editor, double-click Configure which channel of Microsoft Edge to use for opening redirected sites.
  • Select Enabled.
  • Under Options, select your top three choices for the channel to use - Internet Explorer will redirect to the highest ranked choice that the user has installed on that device:
    • Microsoft Edge Stable
    • Microsoft Edge Beta version 77 or later
    • Microsoft Edge Dev version 77 or later
    • Microsoft Edge Canary version 77 or later
    • Microsoft Edge version 45 or earlier
  • Click OK or Apply to save these settings.

3. Use the Enterprise Mode IE website list

This policy setting lets you specify where to find the list of websites you want opened using Enterprise Mode IE.

  • Create or reuse a Site List XML. Sample file is like below:

site.xml:

<site-list version="8">
  <created-by>
    <tool>EMIESiteListManager</tool>
    <version>10.0.14357.1004</version>
    <date-created>08/20/2020 07:45:39</date-created>
  </created-by>
  <site url="www.example.com">
    <compat-mode>IE7</compat-mode>
    <open-in>IE11</open-in>
  </site>
</site-list>
  • In the same path of Group Policy Editor, double-click Use the Enterprise Mode IE website list.
  • Select Enabled.
  • Under Options, type the location of website list. If it's in local, you can set it like this: file://D:/site.xml.
  • Click OK or Apply to save these settings.

Upvotes: 3

Related Questions