How to automatically disable document modus IE7

Posted on 2014-07-29
Last Modified: 2014-07-29

We developed websites where customers can find personal financial information. Now in some cases our customers automatically open a website in Internet Explorer in document modus IE7. It is possible that the user changes this setting by himself at his PC. But I prefer to make a server setting in order to prevent websites displaying in IE7 doc modus. Is that possible?

(I think the problem with the document modus only occurs when our clients use our website in intranet environment. I see that there is a setting 'display intranet sites in compatibility view'. So, how can we automatically disable this option at the server?)


Question by:adiemeer
  • 2
LVL 13

Accepted Solution

duncanb7 earned 500 total points
ID: 40226900
You can use browser detection to detect the user request header which is modified by users on clicking  F12 key in order to  determine what version of document mode users are trying to change, and modified  the page's user-agent  in the header information  before send or response back to user's browser.
For example only,
Users call financial.php to your server and in your finanical.php you have code something like that as follows and the re-send the page to users with or without condition similarly in Example-1 and Example-2
and with your wishing user-agent information for users that will force user to following your rule to view the your-original-finanical.php webpage.

Hope understand your question completely. If not , please point it out.

Example-1: detect IE7 document mode and re-send
$curl = curl_init();  //initital a curl call
curl_setopt( $curl, CURLOPT_USERAGENT,       Mozilla....MSIE 10..your default info...."
$ua= $_SERVER['HTTP_USER_AGENT'];  //get the user's user-agent
if (strpos($ua," "MSIE 7.0)>0){
//Detected IE 7  and change user-agent for IE 10 and  re-send it by curl() 
curl_setopt( $curl, CURLOPT_USERAGENT,       Mozilla....MSIE 10..your new info......."
curl_setopt( $curl, CURLOPT_URL,            "http://yourdomian/your-original-financial.phg  );
$htm = curl_exec($curl); //re-send the page to users 

Open in new window

Example-2, whatever users' document mode, just resend it to original page.
$curl = curl_init();  //initital a curl call
curl_setopt( $curl, CURLOPT_USERAGENT,       Mozilla....MSIE 10..your default info...."
culr_setopt( $curl, CURLOPT_URL,            "http://yourdomian/your-original-financial.phg  );
$htm = curl_exec($curl); //re-send the page to users 

Open in new window


Author Closing Comment

ID: 40228503
Thank you
LVL 13

Expert Comment

ID: 40228513
Thanks for your points

Have  a nice day


Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now