My client is running Apache 2.2.6 on RHEL 5 on i686 arch. I've been tasked with doing a redirect to an external URL if a user connects to our site using a WAP device (or a third site if they're coming in via iPhone) that are hosted by a third party content provider.
I am getting push back from the development team in terms of injecting a .js in front of the index page load, and there is no PHP anywhere in the environment, so I appear to have to fall back onto Apache's capabilities.
The Apache configuration already makes liberal use of mod_rewrite, so rewrites are not a problem. I appear to have a couple of options:
1. some form of RewriteCond %(HTTP_USER_AGENT) where I look for a browser type and redirect externally with a RewriteRule afterwards. This seems difficult due to the amount of browser types there are on mobile phones. Perhaps there a common string?
Here's a list of agent's I'd probably have to sort through:
Looks like I could use a couple strings, with contents like like "MIDP" and "240x320". Still not elegant.
2. Some sort of Content Negotiation? I'm not sure how to take this from idea to code.
3. Demand the developers add a .js detection script to be run before initial page rendering. The web application itself runs on JBoss 4.5 with a jre 1.5 container.
Anyone have any tips on this?