views:

58

answers:

2

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

A: 

Depending on what you are using for web programing add a call. For example with php you could do http://www.example.com/index.php?mobile=usefull and add a header check. If that is present don't redirect.

MrStatic
+1  A: 

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.

Andy E