You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by po...@adindex.co.uk on 2004/03/25 15:30:47 UTC

[users@httpd] WAP Gateway Requests - returning index.wml

Hi

How might Apache HTTP Server be setup to detect WAP gateway requests
and return index.wml rather than index.htm ?

Here is an extract from a wap gateway request header:

-------------------------------------------------
Accept:application/vnd.wap.wmlc,application/vnd.wap.wmlscriptc,
image/vnd.wap.wbmp,application/vnd.wap.wtls-ca-certificate,
text/plain,text/vnd.wap.wmlscript,text/html,text/vnd.wap.wml
Accept-Language:en
Accept-Charset:ISO-8859-1,UTF-8;Q=0.8,ISO-10646-UCS-2;Q=0.6
User-Agent:Nokia7110/1.0 (04.78)
Via:Nokia WAP Server 1.0.2
--------------------------------------------------

Thanks for your consideration. 

Simon
for Adindex.co.uk
and WWW Support Services

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: {SPAM 03.1} [users@httpd] WAP Gateway Requests - returning index.wml

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 25 Mar 2004 postmaster@adindex.co.uk wrote:
> How might Apache HTTP Server be setup to detect WAP gateway requests
> and return index.wml rather than index.htm ?
>
> Here is an extract from a wap gateway request header:
>
> -------------------------------------------------
> Accept:application/vnd.wap.wmlc,application/vnd.wap.wmlscriptc,
> image/vnd.wap.wbmp,application/vnd.wap.wtls-ca-certificate,
> text/plain,text/vnd.wap.wmlscript,text/html,text/vnd.wap.wml

This could be done it two basic ways: with mod_negotation based content
negotiation, or manually negotiating using mod_rewrite.

I'll try to give very quick examples.

1. mod_negotiation with multiviews:

<Directory /path/to/files>
AddType application/vnd.wap.whatever .wap
Options +Multiviews
DirectoryIndex index
</Directory>

Then name your files /path/to/files/index.wap and
/path/to/files/index.html and request them as http://example.com/files/

Apache should look at the Accept header and use that to pick the correct
type.

2. mod_rewrite

RewriteEngine On
RewriteCond %{HTTP_ACCEPT} application/vnd\.wap
RewriteRule ^/files/index /path/to/files/index.wap [L]

RewriteRule ^/files/index /path/to/files/index.html

Neither of these solutions were tested, but they should give you a general
idea.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org