<![CDATA[ Send IE6 user to a specific resource - My Forums]]> https://forums.modx.com/thread/?thread=29637 <![CDATA[Re: Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160430
<?php
$event = 'OnWebPageInit';
$url = $modx->makeUrl(32);
$resId = $modx->resourceIdentifier;
  
if($modx->event->name == $event) {
  if($resId != 32){
    $ua = $_SERVER['HTTP_USER_AGENT'];
  
    if (strpos($ua,'MSIE') != false && strpos($ua,'Opera') === false) {
      if (strpos($ua,'Windows NT 5.2') != false) {
        if(strpos($ua,'.NET CLR') === false) return;
      }
      if (substr($ua,strpos($ua,'MSIE')+5,1) < 7) {
        header('Location: ' . $url);
      }
    }
  }
}
?>​


Don’t know if this is the best solution, but it works for me, and the startpage is not loaded at all before the redirect occurs smiley

If anyone spots any way to optimize this code please reply here smiley]]>
leaase Jul 21, 2010, 07:02 AM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160430
<![CDATA[Re: Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160429 http://sottwell.com/system-events.html]]> sottwell Jul 20, 2010, 11:05 PM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160429 <![CDATA[Re: Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160428 goldsky Jul 20, 2010, 09:22 PM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160428 <![CDATA[Re: Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160427 Quote from: smashingred at Jul 20, 2010, 12:05 PM

You may want to look at using the actual headers to send redirect rather than a conditional comment. This can be done with PHP or JS or both. I’d personally do it with php since you can make it a plugin to do before the page is loaded. The problem with such a plugin is that it must run everytime someone accesses your site regardless of browser.

You should be able to turn this into a plugin pretty easily: http://twodayslate.wordpress.com/2007/09/09/blockredirect-ie6-users/

That’s more what I was looking for smiley

But I have a couple of questions. Would it be best to use the PHP code as a snippet at the top of my header chunck? Or make a plugin out of it? What would be the fastest/smartest way?

Thanks]]>
leaase Jul 20, 2010, 07:23 AM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160427
<![CDATA[Re: Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160426
You should be able to turn this into a plugin pretty easily: http://twodayslate.wordpress.com/2007/09/09/blockredirect-ie6-users/

]]>
smashingred Jul 20, 2010, 07:05 AM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160426
<![CDATA[Re: Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160425
So I’m still hunting smiley]]>
leaase Jul 20, 2010, 06:55 AM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160425
<![CDATA[Re: Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160424
     <head>
        ...

	<!--[if lte IE 6]>
	<meta HTTP-EQUIV="REFRESH" content="0; url=[[~12]]">
	<![endif]-->
    </head>


Change the number 12 to the id of your resource smiley.
]]>
StevenLangbroek Jul 20, 2010, 06:40 AM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160424
<![CDATA[Re: Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160423 Yes, that’s one solution.

But I would still like to have it as a resource in my manager. So I can edit it like any other MODx page.

Any other solutions? smiley]]>
leaase Jul 20, 2010, 06:22 AM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160423
<![CDATA[Re: Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160422
    <head>
        ...

	<!--[if lte IE 6]>
	<meta HTTP-EQUIV="REFRESH" content="0; url=ie-6-must-die.html">
	<![endif]-->
    </head>

grin]]>
goldsky Jul 20, 2010, 04:55 AM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160422
<![CDATA[Send IE6 user to a specific resource]]> https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160421
Is it any of these:
OnWebPageComplete
OnWebPageInit
OnWebPagePrerender
?

Thanks
]]>
leaase Jul 20, 2010, 03:59 AM https://forums.modx.com/thread/29637/send-ie6-user-to-a-specific-resource#dis-post-160421