httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <rob...@profundis.nu>
Subject Re: [users@httpd] How to Configure Apache to detect browser and request apropriade Index.* file.
Date Tue, 21 Sep 2004 10:32:46 GMT
João Gil ACE-SC wrote:
>   Is it possible to configure apache to detect bowser type and depending
>   on the browser, apache requests the apropriate index.* file. Eg it the
>   browser is a WAP device apache would open index.wml else index.html.
>   If it is possible what do I have to do?

You can problably do it using BrowserMatch and env variables. Possibly also
simply using multiviews, but I'm not sure.

One way is using mod_rewrite. This very much depends on your site, but to
illustrate:

RewriteCond %{USER_AGENT} WAP
RewriteRule (.*)\.html $1\.wml

How to safely match a WAP device, I don't know. See:
http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html#rewritecond
http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html#rewriterule

Content-negotiation (multiviews) is another possibilty, beacuse the client
should send Accept-* request headers indicated supported formats etc, and
then Apache selects the most appropriate version of the resource. How this
could work with WAP devices, I don't know. See:
http://httpd.apache.org/docs-2.0/content-negotiation.html

Regards,
Robert Andersson


---------------------------------------------------------------------
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


Mime
View raw message