Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite for WML and XHTML MP files

         

Markus Klaffke

10:59 am on Mar 27, 2004 (gmt 0)

10+ Year Member



I have written three different copies of my website für mobile devices.

1. a *.html version (a version without graphics etc.)
2. a *.wml version
3. a *.xhtml version

Ok, that was easy. I am using a CMS.

Now i have the problem to redirect a device that only understands *.wml to my index.wml, and a device that understands XHTML MP to redirect to a index.xhtml. As for the html version i am not sure. Do i really need that?

I have tried to search google for my problem. But did not find anything. Also on the Motorola oder NOKIA websites i couldn´t find a solution.

Is anybody here in this forum who is running two different mobile versions of his website and can help me out with a mod_rewrite rule?

Thanks in advance.
Markus

jdMorgan

7:05 pm on Mar 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Markus,

Well, I've never experimented with wireless device coding before, but if you know the user-agents used by WML, WAP, and other wireless devices, you could redirect based on the user-agent. I mentioned WAP because you'll need your html version to support access through HTML-WAP proxies (translators) like Google offers.


RewriteCond %{HTTP_USER_AGENT} ^Some_WML_Only_agent$
RewriteRule ^index\.html$ /index.wml [L]
RewriteCond %{HTTP_USER_AGENT} ^Any-XHTML-User-Agent$
RewriteRule ^index\.html$ /index.xhtml [L]

Jim