Kernel_Killer
July 4th, 2006, 22:00
So, I set up a WAP virtual server on one of my Apache servers, and all seems well. I'm trying to make it to where phones that support html go to the html page, and phones that can only view WML pages are redirected to the wml page. Unfortunatly my phone is a html based phone, and does not do WML (yeah, wtf??). I'm using a online-emulator (http://www.wapsilon.com/) to test the WML page.
If you go to the site with the emulator on the root of the site, you get:
Wrong mime-type, I got text/html, but I want text/vnd.wap.wml.
This error occurs when you request a page that is not a WAP page, or when the webserver isn't set up correctly for hosting WAP sites
Now, if you browse to the domain with index.wml at the end, the site shows fine. So, a redirect issue, right?
Here is what Apache's error.log shows:
[Tue Jul 04 21:41:06 2006] [notice] SIGHUP received. Attempting to restart
PHP Warning: mime_magic: type regex\t\tBEGIN[[:space:]]*[{]\tapplication/x-awk invalid in Unknown on line 0
[Tue Jul 04 21:41:06 2006] [notice] Apache/2.0.55 (Debian) PHP/4.4.2-1.1 configured -- resuming normal operations
I had to do the page with a PHP header because for some reason the XML header always makes the emulator error.
This is what I've added to Apache in the apache2.conf to redirect:
RewriteEngine on
# Catch most WAP browsers
RewriteCond %{HTTP_ACCEPT} text/vnd\.wap\.wml [OR]
# WinWAP, WAPjag
RewriteCond %{HTTP_USER_AGENT} wap [OR]
# Nokia emulators (sdk)
RewriteCond %{HTTP_USER_AGENT} 7110
# Rewrite!!
RewriteRule ^[\./](.*)$ /welcome_wap_user.wml [L]
Mod_rewrite is also enabled, and shown in the mods-enabled directory. Any ideas? The site is http://blvddrin.com.
Just in case, here is the page:
<?php
# Send the header information<br>
header("Content-type: text/vnd.wap.wml");
?>
<wml>
<card id="index" title="Blvd Drin">
<p>
Now Playing<br/>
<b>Listing</b>
</p>
</card>
<card id="movie1" title="Test">
<p>
test
</p>
</card>
<card id="movie2" title="test2">
<p>
test2
</p>
</card>
</wml>
If you go to the site with the emulator on the root of the site, you get:
Wrong mime-type, I got text/html, but I want text/vnd.wap.wml.
This error occurs when you request a page that is not a WAP page, or when the webserver isn't set up correctly for hosting WAP sites
Now, if you browse to the domain with index.wml at the end, the site shows fine. So, a redirect issue, right?
Here is what Apache's error.log shows:
[Tue Jul 04 21:41:06 2006] [notice] SIGHUP received. Attempting to restart
PHP Warning: mime_magic: type regex\t\tBEGIN[[:space:]]*[{]\tapplication/x-awk invalid in Unknown on line 0
[Tue Jul 04 21:41:06 2006] [notice] Apache/2.0.55 (Debian) PHP/4.4.2-1.1 configured -- resuming normal operations
I had to do the page with a PHP header because for some reason the XML header always makes the emulator error.
This is what I've added to Apache in the apache2.conf to redirect:
RewriteEngine on
# Catch most WAP browsers
RewriteCond %{HTTP_ACCEPT} text/vnd\.wap\.wml [OR]
# WinWAP, WAPjag
RewriteCond %{HTTP_USER_AGENT} wap [OR]
# Nokia emulators (sdk)
RewriteCond %{HTTP_USER_AGENT} 7110
# Rewrite!!
RewriteRule ^[\./](.*)$ /welcome_wap_user.wml [L]
Mod_rewrite is also enabled, and shown in the mods-enabled directory. Any ideas? The site is http://blvddrin.com.
Just in case, here is the page:
<?php
# Send the header information<br>
header("Content-type: text/vnd.wap.wml");
?>
<wml>
<card id="index" title="Blvd Drin">
<p>
Now Playing<br/>
<b>Listing</b>
</p>
</card>
<card id="movie1" title="Test">
<p>
test
</p>
</card>
<card id="movie2" title="test2">
<p>
test2
</p>
</card>
</wml>