Redirecting Mobile Web Users

There are a few potential methods for this, but the first worked fine for me.
1. Apache Mod_Rewrite

RewriteEngine On
#redirect mobile browser using HTTP_ACCEPT header
RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC]
RewriteCond %{HTTP_HOST} "!m.yourmobileurl.com" [NC]
RewriteRule (.*) http://m.yourmobileurl.com/$1 [L]
#some high-end phone sometimes support HTML, only its sucks
#add more browser user agent sig here
RewriteCond %{HTTP_USER_AGENT} (nokia|symbian|iphone|blackberry) [NC]
RewriteCond %{HTTP_HOST} "!m.yourmobileurl.com" [NC]
RewriteRule (.*) http://m.yourmobileurl.com/$1 [L]

2. Wurfl and PHP API

3. Apache Mobile Filter

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>