Hey guys,
I have a mobile site that gets redirected through the .htaccess file. There is a link on the mobile site to view the full site. But, when the user clicks on the link, they are always redirected back to the mobile site. I have set up a script to run when the user clicks on the link to access the full site that creates a cookie "mobile=no" on the mobile site.
Im having a real hard time trying to configure the .htaccess file so that, if this cookie is set, don't redirect.
Here is the code:
RewriteCond %{HTTP_COOKIE} !^mobile=no$
RewriteCond %{HTTP_HOST} !^m\.stage\.sunjournal\.com$
RewriteCond %{HTTP_USER_AGENT} "android|iPhone|blackberry|iemobile|operamobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ [L,R=302]
I have a mobile site that gets redirected through the .htaccess file. There is a link on the mobile site to view the full site. But, when the user clicks on the link, they are always redirected back to the mobile site. I have set up a script to run when the user clicks on the link to access the full site that creates a cookie "mobile=no" on the mobile site.
Im having a real hard time trying to configure the .htaccess file so that, if this cookie is set, don't redirect.
Here is the code:
RewriteCond %{HTTP_COOKIE} !^mobile=no$
RewriteCond %{HTTP_HOST} !^m\.stage\.sunjournal\.com$
RewriteCond %{HTTP_USER_AGENT} "android|iPhone|blackberry|iemobile|operamobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ [L,R=302]