954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

mobile htaccess cookie

I have a mobile site that the user gets automatically redirected to if they are trying to access the full site from a mobile device. I need them to be able to access the full site too, if they prefer.

I have set a cookie in my htaccess file. What is the logic for saying it is ok for them to visit the full site if this cookie is set, if they are try to access it through the mobile site?

#redirect
RewriteCond %{HTTP_HOST} !^m\.stage.sunjournal\.com$
RewriteCond %{HTTP_USER_AGENT} "android|iPhone|blackberry|ipad|iemobile|operamobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ http://m.stage.sunjournal.com/$1 [L,R=302,CO=mobile:yes:m.stage.sunjournal.com:30:/]

RewriteCond %{HTTP_COOKIE} mobile=yes
RewriteCond %{REQUEST_URI} !^stage.sunjournal.com [NC]
RewriteRule ^(.*)$ http://stage.sunjournal.com/$1 [L,R=302]
bwaltz
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: