GZICP.com   
 
    返回首页
    联系我们
 
 
     

在Apache上简简单单开个WAP站点

www.gzicp.com   2004年8月24日 21:35:39
 

现在可以上网的手机越来越多, 要是可以随时在手机上面看到自己的网站的相关信息, 岂不是非常Happy么。现在就动手,其实很简单。打开/path/to/httpd.conf:在最后添加以下配置内容

#Wap MIME
AddType  text/vnd.wap.wml  .Wml
AddType  application/vnd.wap.wmlc .Wmlc
AddType  image/vnd.wap.wbmp .Wbmp
AddType  application/vnd.wap.wmlscriptc .wmlsc
AddType  text/vnd.wap.wmlscript .Wmls
AddType  application/vnd.wap/wmlscriptc .Wsc

然后使配置生效。

就这么简单,你的Apache已经可以支持Wap访问了。

来吧:手机打开http://我的网站/index.php,我靠,哪里支持啊。

对不起对不起,忘记说了,手机wap浏览器不是网页浏览器,恐怕整个手机的容量还没有网页浏览器的软件那么大。用Wap浏览器就得遵守Wap的语言wml了,下面来个简单的例子:
在站点根目录建议wap,在wap里面建立test.wml,内容如下:

<?xml version="1.0" encoding="GB2312"?> 
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" 
"http://www.wapforum.org/DTD/wml_1.1.xml"> 

<wml>
<!-- Possible <head> element here. -->
<head>
<meta forua="true" http-equiv="Cache-Control" content="max-age=0"/>
<meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>
</head>
<template>
<!-- Template implementation here. -->
<do type="prev"><prev/></do>
</template>
<card id="card1" title="wap" newcontext="true">
<p>
<b>输入:</b><br/>
<input name="SID" size="10" maxlength="50" type="text" format="*N" emptyok="true"/><br/>
<br/>
<anchor title="login">
<go href="request.asp" method="post">
<postfield name="code" value="$SID"/>
</go>Implement!<br/>
</anchor>
</p>
</card>
</wml>

来吧:手机打开http://我的网站/wap/test.wml,我靠,真的支持啊。

这里我就不多讲什么wml语言了,自己去baidu多的是资料啊。
遵循wap的游戏规则,你可以使用php或者cgi来写你的动态wml页面了,把服务器的一些信息给处理后送到wml页面,不就可以随时手机查看站点情况了么?!!!

chinaunix.net HonestQiao

最新文章
·Apache 服务器Log分析应用实例  (2005年03月14日)
·大容量虚拟主机的动态配置  (2004年08月24日)
·在Apache上简简单单开个WAP站点  (2004年08月24日)
·整合TOMCAT5+APACHE2+jk2  (2004年08月24日)
·Apache2的httpd.conf翻译  (2004年08月24日)
·基于Apache服务器的文件防盗链  (2004年08月24日)





 
 
Copyright © 1999-2005 GZICP.com All Rights Reserved