Today I saw that the homepage of a friend's WAP website can be browsed with IE and WAP mobile phones. It seems that he must have checked the browser. If it does not support WML, then redirect it.
After thinking about it carefully, Redirect is only for browsing that does not support WML. Operations performed by the browser (such as IE)
So Response.Redirect can still be used. The key is how to judge whether the browser supports it.
So I asked a friend for the code and got this:
if (strpos("wap", $_HTTP_GET_VARS['http_accept'])) { header(" Location: http://hikey.net ");}
PHP code...
But my program is ASP, so I have this code:
<%
Response.Buffer = TRUE
Dim IsWap
httpAccept = LCase(Request.ServerVariables("HTTP_ACCEPT"))
if Instr(httpAccept,"wap") then
IsWap=1
Else
Response.Redirect " http://www.gelon.net/cgi-bin/wapalize.cgi?url=http://hikey.net/wap "
Response.End
End if
%>
Add this code to the head of your WAP page (the very top!) and you will do it: if the browser does not support it, redirect it to the WAP simulator provided by Gelon.net with the following URL= You can change it to your website address.
Even if others only know your website address and don't know how to access your website, they can still see the effect...