redirect based on browser and OS
our current site won't work with mac os 9 / IE 5. i need a simple way to redirect them to a page telling them this if it's detected. if they meet the requirements they are automatically forwarded to the actual site.
anybody want to help a brother out?
Back to top
Well, you can use php browser detection script, which will do the job fine.
Either one will work, although the php one is going to be more reliable etc.
The web programming forums have many threads on how do the php browser detection stuff, so please don't ask how to do it until you've read them all, typing in the same answers is boring and not very productive.
But if that seems like overkill, which it is, all you really have to do is test the browser user agent for two things, the mac identifier, and msie. If that's all you need to do, that's how I'd handle it, no point in overkill unless you need the other features.
You can also do this type of test in apache htaccess, by the way, by testing the requesting user agent, you set two conditions, one that it has mac in the string, and the other that it has msie 5.x in the string, where x = 0 or 1, but not 2. MSIE mac 5.2 is only osx. It sucks too by the way, so really the best idea is just totally forget about supporting msie mac at all, just detect for mac AND MSIE in the string.
If your site runs either ASP or on Microsoft IIS server, sorry, we dont' support either here, just open source stuff.
Back to top
All times are GMT - 8 Hours