Can Apache configuration check cookies?

Posted by nickf on Stack Overflow See other posts from Stack Overflow or by nickf
Published on 2010-03-25T04:22:41Z Indexed on 2010/03/25 4:23 UTC
Read the original article Hit count: 183

Filed under:
|
|
|

My situation:

We have a mobile version of our website, and want to start redirecting mobile users to it. The plan is to do this in Apache httpd.conf or .htaccess, using something like this:

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} (iPhone|Blackberry|...)
RewriteRule (.*) mobile/$1

However we want there to be a way for users to override our default action of redirecting them. One way we thought to do it was to show a link on the mobile site directing back to the regular site, and store a cookie when they use that link.

Could the Apache configuration file check a cookie before redirecting?

Is there a better way?

© Stack Overflow or respective owner

Related posts about apache

Related posts about mobile