Configuring the viewport on iPhone and iPod Touch

4/08/2009

By default, Mobile Safari assumes that the page is 980px wide and sizes the viewport accordingly. If your page is significantly smaller, you can use the viewport meta tag to configure the viewport dimensions. For example:

<meta name="viewport" content="width=320" />

Detailed documentation is available at developer.apple.com.

In portrait mode, the viewport is 320px wide; in landscape mode, it’s 480px wide.

1 Comment

Apache: rewriting requests for iPhone and iPod Touch

4/08/2009

This snippet will rewrite all requests to the page iphone.html when viewed on iPhone or iPod Touch. Requests for .gif and .css files are not rewritten, so you can include stylesheets and images in your iPhone-specific page.

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} .*Mobile.*Safari
RewriteRule !\.(gif|css)$ /iphone.html  [L]

Source: http://webdirect.no/mobile/apache-rewrite-rule-for-iphone-users/

No Comments