Forum Moderators: open

Message Too Old, No Replies

WAP detection and redirect?

How to redirect users using mobile devices?

         

senior mcinvale

3:49 pm on May 14, 2003 (gmt 0)

10+ Year Member



I plan on adding a WAP version of the most popular sections of my site in the next couple of weeks. I want WAP user agents to type in www.example.com and be redirected to wap.example.com.

How can I go about this? Browser detection? IP ranges? Something else?

Also, does anyone know of any good WAP tutorials? I have been reading the W3C guidelines, just looking for more resources :)

Thanks.

[edited by: tedster at 6:47 pm (utc) on July 25, 2004]
[edit reason] use example.com [/edit]

Stretch

4:17 pm on May 14, 2003 (gmt 0)

10+ Year Member



One of my sites uses cold fusion to check for available mime types. If wap capability is detected it redirects. I guess the same in PHP (or whatever your using) would work.

I've tested this using a range of different wap devices and it works fine for me. Not sure how fool proof this method is though to be honest.

The code I use is:

<CFIF #CGI.HTTP_ACCEPT# CONTAINS "text/vnd.wap.wml"> <CFLOCATION URL="http://wap.example.com"> </CFIF>

dtmuk

5:05 pm on Jul 25, 2004 (gmt 0)

10+ Year Member



As you said this to Redirect if the user from mysite.com to wap.mysite.com if the browser is a wap broswer you can do something similar in php, my code does the exact same method as your coldfusion code:

Here it is:

<?
if(preg_match("/vnd.wap.wml/",$_SERVER['HTTP_ACCEPT'])){
header("Location: http://wap.mysite.com/");
exit;
}
?>

This Works for me...

David Middlehurst

[edited by: tedster at 6:51 pm (utc) on July 25, 2004]
[edit reason] splice two threads [/edit]

Running Wolf

7:27 pm on Jul 30, 2004 (gmt 0)

10+ Year Member



can cold fusion code be added straight into dreamweaver? how is everyone testing their redirects?