I would like to forward iphone users to a mobile version of my site with apache’s RewriteCond %{HTTP_USER_AGENT} (...)
My question is, how would I redirect visitors of the mobile site back to the full site? Since they’re on a mobile device, they’d just get re-routed to the mobile site again right?
Cheers,
Phil
You should redirect to a page that sets a cookie value, then redirects back to the main page again. Then you can do a cookie-based rewrite – if the cookie is present, don’t rewrite the URL. If it’s not present, do the rewrite.
The benefit of this, other than not having to append a GET variable to the URL, is that your user’s preference is stored for future visits. If he/she prefers the full format of the site that’s what they will see the next time they visit.