Newer
Older
Basic idea:
This service is a mobile proxy for UNL template pages.
The proxy grabs the page, pulls out the maincontentarea and navigation and
displays it in a popup template. The navigation UL is placed at the bottom of
the page below the content.
Auto redirecting to this proxy, sample .htaccess rules:
RewriteEngine On
Brett Bieber
committed
# If mobile=no, don't redirect the user specifically requests no mobile version
RewriteCond %{QUERY_STRING} !mobile=no$
# If cookie wdn_mobile = no, don't redirect
RewriteCond %{HTTP_COOKIE} !^.*wdn_mobile=no.*$ [NC]
Brett Bieber
committed
# If iPad user, don't auto-redirect to mobile
RewriteCond %{HTTP_USER_AGENT} !iPad [NC]
Brett Bieber
committed
# if the browser accepts these mime-types, it's definitely mobile, or pretending to be
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC,OR]
# a bunch of user agent tests
RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera mini" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox" [NC,OR]
Brett Bieber
committed
RewriteCond %{HTTP_USER_AGENT} "blackberry|ericsson,|panasonic|philips|sanyo|sharp|sie-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic|alcatel|ericy|vodafone\/|wap1\.|wap2\.|iPhone|android" [NC]
Brett Bieber
committed
# capture the entire requested URL, including querystring
RewriteCond %{THE_REQUEST} ^[A-Z]+\ ([^\s]+)
Brett Bieber
committed
# go to the mobile proxy
RewriteRule ^$|^.*\/$|^.*\.shtml$ http://m.unl.edu/?view=proxy&u=http://%{HTTP_HOST}%1
TODO:
There's a cleaner way to scan the pages, I just can't find the api for it now.
[X] Capture link clicks so links to other UNL pages are run through the proxy.
{X] Add link to view the html version of the page ala Google mobile version.
Detect mobile screen size and adjust css accordingly?