March 13th, 2006, 10:26 PM
-
March 13th, 2006, 10:29 PM
-
March 13th, 2006, 10:35 PM
-
Content Type
To get mobiles content served correctly from your server, in this example Apache 2x no real configuration is needed, especially if you use PHP to modify headers. However, if you would like Apache to handle .mhtml files as application/vnd.wap.xhtml+xml, then AddType is what you are looking for. These modifications can be made at server level or per directory using .htaccess if your server's configuration permits.
[code=httpd.conf]AddType application/vnd.wap.xhtml+xml .mhtml
#same can be done for wml file extension if it isn't serving as text/vnd.wap.wml
AddType text/vnd.wap.wml .wml
[/code]
To get PHP to do this for you, see the following examples:
test_wml.php Code:
<?php
header('Content-Type: text/vnd.wap.wml; charset=ISO-8859-1');
// rest of your code below
?>
test_mhtml.php Code:
<?php
header('Content-Type: application/vnd.wap.xhtml+xml; charset=ISO-8859-1');
// rest of your code below
?>
ASP and JSP examples to follow.
Good tutorial:
SERVER SETUP:
http://www.developershome.com/wap/wapServerSetup/
Cheers,
Jamie
>_ My Music Blog | Losing weight @notsoheavyblog | My Tweets
__________________
Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.
__________________
March 13th, 2006, 10:39 PM
-
Testing
Before uploading you should validate your code.
Q: Why?
A: Because WAP 1 and WAP 2 are derivatives of XML, any malformed code will cause the page to break,
leading to, in most cases, a page that won't render at all. XML is essentially a stricter version of HTML,
which requires html tags to be in the right order, proper nesting, and closed correctly.
xml code examples Code:
<?
// incorrect code examples
?>
<p><strong>Some text here</p></strong>
<img src=someimage>
<input type=checkbox checked> Yes
<br>
<?
// above code corrected
?>
<p><strong>Some text here</strong></p>
<img src="someimage" />
<input type="checkbox" checked="checked" /> Yes
<br />
See the tutorials links above for more info. To help, you can validate your code online using a validator.
Online Validators
http://www.w3schools.com/wap/wml_validate.asp
http://www.validome.org/
http://mr.dev.mobi/
Last edited by jabba_29; December 28th, 2006 at 02:23 AM.
Reason: Added resource
Cheers,
Jamie
>_ My Music Blog | Losing weight @notsoheavyblog | My Tweets
__________________
Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.
__________________
March 13th, 2006, 10:47 PM
-
March 13th, 2006, 10:50 PM
-
March 13th, 2006, 10:55 PM
-
More Resources & Further Reading
Last edited by jabba_29; July 18th, 2007 at 12:29 AM.
Reason: added resource
Cheers,
Jamie
>_ My Music Blog | Losing weight @notsoheavyblog | My Tweets
__________________
Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.
__________________
June 20th, 2007, 09:17 PM
-
Google Wireless Transcoder
Here are some tips for Google Wireless.
You can tell whether your site is being accessed by Google Wireless Transcoder by its user-agent string.
If you have some sort of detection script running you can look for Googlebot-Mobile in the UA string.
If it is found in the string, render mobile content accordingly.
In addition, you can stop mobile pages from being transcoded by
adding the following lines to the <head></head> of your document...
php Code:
<link rel="alternate" media="handheld" href="alternate page" />
Note that you do not need to do this for pages that are served in a mobile friendly content type format *:
text/vnd.wap.wml
application/vnd.wap.xhtml+xml
These formats should by default be left alone by the transcoder.
* The device detection script that I use finds best suited content-type and
renders my mobi in text/html if the browser cannot handle application/vnd.wap.xhtml+xml.
Therefore it serves text/html to Google and I need to insert the afore mentioned HTML into the head of my documents.
Pages for imode for example Google will try to transcode the pages as content type should be text/html.
This post is an extension of this thread!
Cheers,
Jamie
>_ My Music Blog | Losing weight @notsoheavyblog | My Tweets
__________________
Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.
__________________