• 0

re-direct if IE detected


Question

14 answers to this question

Recommended Posts

  • 0

I've heard that it's not always reliable to check the user's browser from PHP, but I admit I haven't researched it much. You're probably fine doing it this way since the cases where it doesn't work is likely someone doing something they shouldn't be doing.

  • 0
I've heard that it's not always reliable to check the user's browser from PHP, but I admit I haven't researched it much. You're probably fine doing it this way since the cases where it doesn't work is likely someone doing something they shouldn't be doing.

It's actually very unreliable. In fact, there's not a single way you could discriminate between different browsers by relying solely on some variable supplied by a browser, because they could all be changed with relative ease. The only sure way is to put a hack together that exploits the varying degree of technological sophistication amongst the different rendering engines, and make them filter themselves (if the browser doesn't support a certain technology, editing the UA won't change a damn thing). Suffice it to say, not very pretty and often not possible anyways. Only under very limited circumstances could you effectively tell what browser is what, so there's basically no point in trying to discriminate amongst them. The effort would be much better spent making the website just work with every browser.

  • 0

bad idea, just make it work in every browser :)

but if you really want to do this there is a better way

<!--[if lte IE 6]>

<script type="text/javascript">

window.location = "blabla";

</script>

<![endif]-->

will let you redirect ie6. I don't see any reason to redirect ie7 because a lot of the hacks aren't necessary anymore and making a site work in ff, opera and ie7 isn't really that difficult

  • 0
bad idea, just make it work in every browser :)

but if you really want to do this there is a better way

<!--[if lte IE 6]>

<script type="text/javascript">

window.location = "blabla";

</script>

<![endif]-->

will let you redirect ie6. I don't see any reason to redirect ie7 because a lot of the hacks aren't necessary anymore and making a site work in ff, opera and ie7 isn't really that difficult

IE7 has some rather....shall we say, interesting, rendering bugs that I don't believe occured in IE6.

In any case, why not just use if lt IE7? (1 less character!), and the javascript redirect won't work for everyone. Same problem with meta redirects as well.

  • 0
In fact, there's not a single way you could discriminate between different browsers by relying solely on some variable supplied by a browser, because they could all be changed with relative ease...

Only under very limited circumstances could you effectively tell what browser is what, so there's basically no point in trying to discriminate amongst them. The effort would be much better spent making the website just work with every browser.

Until Microsoft get their act together and properly deal with the XHTML1.1 content type (and by which time you shouldn't / won't want to redirect) you can check $_SERVER['HTTP_ACCEPT'] / Request.ServerVariables("HTTP_ACCEPT") for "application/xhtml+xml". Opera says it can handle it, as does the fox, Safari does the IE trick of allegedly supporting everything ("*/*"), unless that's changed recently. Whilst UA is easy peasy (even for IE) to change, the Accept shouldn't be able to be altered.

  • 0
Until Microsoft get their act together and properly deal with the XHTML1.1 content type (and by which time you shouldn't / won't want to redirect) you can check $_SERVER['HTTP_ACCEPT'] / Request.ServerVariables("HTTP_ACCEPT") for "application/xhtml+xml". Opera says it can handle it, as does the fox, Safari does the IE trick of allegedly supporting everything ("*/*"), unless that's changed recently. Whilst UA is easy peasy (even for IE) to change, the Accept shouldn't be able to be altered.

it's possible, why anyone would ever want to change it is beyond me. but as you said, using http_accept will give you problems with safari (which is more correct than IE in claiming */*).

  • 0

I used to check to see if it contained "MSIE", but didn't contain Opera (because Opera used to identify as IE)

And don't check for Safari, check for WebKit, otherwise you'll break other mac browsers (and some are really fun, they use WebKit but override XHTML rendering and treat it as RSS!)

:sleep:

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Ventoy 1.1.16 is out.
    • This is a none story - these low volume Chinese models will always get new experimental features first because Apple and Samsung can't produce them in huge volume to meet demand.
    • Nvidia GeForce NOW gains support for Dark Scrolls, Empulse, and more by Pulasthi Ariyasinghe The final update of June for Nvidia's cloud gaming service GeForce NOW is now available, and it is touting support for six more games. The company is also drawing subscriber attention towards the summer sales kicking off across stores, so they can stock up on more cloud-supported titles. Of course, the Steam Summer Sale is the biggest promotion, which is kicking off later today. "Supported Steam games can be streamed across devices with GeForce NOW, making it easy to buy a game once, keep progress synced and pick up where the gameplay left off on PCs, Macs, handheld devices, phones, TVs and more," says the company. "In other words, the Steam Summer Sale brings the deals; GeForce NOW adds the flexibility." Don't forget that the GeForce NOW summer sale is still active as well. This limited-time offer drops the 12-month Performance membership from $99.99 to $64.99, saving members $35. At the same time, the 12-month Ultimate membership is currently going for $129.99, dropping the price by $70 from the original $199.99. Here are the games joining GeForce NOW's supported list this week: Dark Scrolls (New release on Steam, available June 22) SAND: Raiders of Sophie (New release on Steam, available June 22) Deer & Boy (New release on Steam, available June 23) EMPULSE (New release on Steam, available June 24) The Adventures of Elliot: The Millennium Tales (Steam) FATAL FURY: City of the Wolves (Steam) With the June expansions coming to an end, Nvidia should be announcing its July GeForce NOW plans next week. Keep in mind that, unlike subscription services like Game Pass or EA Play, a copy of a game must be owned by the GeForce NOW member (or at least have a license via PC Game Pass) to start playing via Nvidia's cloud servers. There is also a limit to how many hours subscribers can use the service per month.
    • Davinci Resolve 21.0.1 by Razvan Serea DaVinci Resolve is the world’s only solution that combines editing, color correction, visual effects, motion graphics and audio post production all in one software tool! Its elegant, modern interface is fast to learn and easy for new users, yet powerful for professionals. DaVinci Resolve lets you work faster and at a higher quality because you don’t have to learn multiple apps or switch software for different tasks. That means you can work with camera original quality images throughout the entire process. It’s like having your own post production studio in a single app! Best of all, by learning DaVinci Resolve, you’re learning how to use the exact same tools used by Hollywood professionals! DaVinci Resolve is the only post production software designed for true collaboration. Multiple editors, assistants, colorists, VFX artists and sound designers can all work on the same project at the same time! Whether you’re an individual artist, or part of a larger collaborative team, it’s easy to see why DaVinci Resolve is the standard for high end post production and is used for finishing more Hollywood feature films, episodic television programing and TV commercials than any other software. Davinci Resolve 21.0.1 release notes: Addressed multiple DNG and Apple ProRAW color issues. Addressed issue with automatic smart bins after deleting keywords. Addressed issue with multiple linked audio in media management. Addressed multiple Resolve FX issues in photo page. Addressed issue with key shortcut to switch viewer in photo page. More consistent creation of new photo albums. Addressed color thumbnail refresh for photo transform indicator. Transcription now honors project settings language. Improved face recognition in IntelliSearch. Addressed exported bins not retaining generator and title properties. Addressed ease control display and sensitivity issues. Addressed keyframe issue when copying clips with Fusion effects. Addressed keyframe refresh for Fusion effects in the edit page. Addressed issue with 3D renders in Linux with non-English locales. Addressed Fusion viewer color issue for some RCM settings. Addressed issue with saturation limits in Fusion gradient controls. Addressed Fusion display issues with dual screen layouts. Addressed issue with non-English character inputs in Linux. Disabling MultiMaster now disables trim blanking controls. Addressed crash in some scenarios with CineFocus. Addressed lag when toggling bypass grades and Fusion effects. Addressed occasional issue with Fairlight loudness meters. Addressed data burn display of good take tag in upgraded projects. Addressed project manager scroll lag for large project libraries. Support for Sony Alpha 7R VI ARW RAW stills. Support for decoding Affinity RGB 16-bit formats. Addressed a color issue with MainConcept H.265 HDR renders. Addressed a color issue with Windows native H.265 HDR renders. RemoveMotionBlur API now uses correct encode parameters. Addressed character limit consistency in GenerateSpeech API. General performance and stability improvements. Download page: Davinci Resolve 21.0.1 | 3300 MB (Free, paid upgrade available) Links: DaVinci Resolve Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • There are so many of these apps now that do this, what do people recommend?
  • Recent Achievements

    • First Post
      kinowa earned a badge
      First Post
    • Rookie
      krychek57 went up a rank
      Rookie
    • Grand Master
      Jaybonaut went up a rank
      Grand Master
    • One Year In
      Philsl earned a badge
      One Year In
    • Dedicated
      Scoobystu earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      463
    2. 2
      +Edouard
      172
    3. 3
      PsYcHoKiLLa
      134
    4. 4
      Michael Scrip
      78
    5. 5
      Xenon
      77
  • Tell a friend

    Love Neowin? Tell a friend!