WAP向けサイト作成用のWebサーバの設定です。
WebサーバにApacheを利用する場合の設定となっています。
以下の記述を、Apacheの設定ファイルhttpd.confか、.htaccessに記述します。
専用サーバや自作サーバ以外では、httpd.confの編集はできませんので、一般的には.htaccessを使います。
AddType text/x-hdml;charset=Shift_JIS .hdml AddType text/x-hdml;charset=UTF-8 .utf8-hdml
AddType text/vnd.wap.wml;charset=Shift_JIS .wml AddType text/vnd.wap.wml;charset=UTF-8 .utf8-wml AddType text/vnd.wap.wmlscript;charset=Shift_JIS .wmls
AddType image/bmp .bmp AddType image/png .png AddType image/jpeg .jpg
通常、http://wap2.jp/などのようにスラッシュ(/) で終わるURLリクエストがあると、
そのディレクトリ内のindex.htmlが呼ばれます。
これを、他のファイルに置き換えることが出来ます。
DirectoryIndex index.cgi index.hdml index.wml index.html
スラッシュ(/) で終わるURLリクエストがあると、サーバーはDirectoryIndexで記述されているファイルを左から順に探していき、見つかればそのファイルを表示します。
上記の設定の場合、サーバーは、index.cgi→index.hdml→index.wml→index.htmlの順でファイルを探していき、見つかった時点でそのファイルを表示します。
AddType audio/3gpp2 .3g2 AddType video/3gpp2 .3g2 AddType application/x-shockwave-flash .swf AddType application/x-mpeg .amc AddType video/3gpp .3gp
AddType audio/vnd.qcelp .qcp AddType application/x-smaf .mmf AddType application/x-pmd .pmd AddType text/x-vcard;charset=Shift_JIS .vcf AddType text/x-vcalendar;charset=Shift_JIS .vcs