1
<!DOCTYPE html">
<html lang="en">
<head>
<meta charset="utf-8">
<title> Redirecting EWS Manager to Chrome </title>
<h1>Browser Redirecting ......</h1>
<script type="text/javascript">
{ varshell = new AciveXObject("WScript.Shell");
shell.run("Chrome //new Link here//");
window.location.replace("#old link the default browser"):}
setTimeot("pageRedirect()",3000);
</script>
</head?
</html>

Above code is for redirecting and named as redirect.html. But it only works when I open my website in IE so that it will redirect to Chrome. But If I open in Chrome, it will only shows Redirecting to Chrome. It does't work in Chrome, It only works in IE. Opening in IE and redirecting to Chrome is works. But reopening in Chrome doesn't work. May I know why and can you please show me a way to fix it?

echo "                  <tr><td class=\"left_padding\"><a class=info href=\"http://sgewsweb.amk.st.com:8080/web/system/usermgr7/redirect_edge.html\" >User Manager<span>EWS Administrator</span></a></td></tr>";

This link is from my default homepage. When I click to the tab, it opens in Chrome. Some says I have to do with onclick function but I have no idea how to use it. Can you please fix it for me?

enter image description here When I open Chrome, it pperars like this.

  • "_it only works when I open ..._" Only, and only if _you_ open a website in IE, others have protected their machine by not allowing ActiveX execution. See https://stackoverflow.com/questions/10070744/open-ie-browser-in-firefox-chrome-page – Teemu Nov 18 '21 at 06:26
  • Is it because of I use ActiveXObject>? –  Nov 18 '21 at 06:42
  • Yes, it's potentially dangerous to allow arbitrary web pages to exectute ActiveX. – Teemu Nov 18 '21 at 06:47
  • So, how can I redirect to others browsers by from Using IE –  Nov 18 '21 at 06:51
  • 3
    You can't, let your user decide which browser they use, and create all-browser-compatible web pages. And drop the support for IE, even its vendor has abandoned it for years ago. Also, how would you know if a user has even installed a specific browser on their machine? – Teemu Nov 18 '21 at 06:55

1 Answers1

0

You can try redirecting through header location in php. It will work in all browsers. However, it needs to be placed before any html output.

<?php header('Location: newlink.php'); ?>
Ammar Aslam
  • 560
  • 2
  • 16