bwaltz 0 Newbie Poster

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]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.