You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joshua Slive <jo...@slive.ca> on 2004/03/25 15:46:27 UTC

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

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