I currently an redirecting to a mobile site based through htaccess as follows:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteRule ^$ http://m.example.com/ [L,R=302]
Is there someway to have a full site button on my mobile version that will ignore this rule if clicked? I don't want to use javascript to do my redirect and check for full site...I'm okay with the idea of php doing it though, but I know htaccess gets knocked off before php rules.
You can create a button/href link with this URL:
<a href="/?desktop=1">Full Desktop Site</a>
And then change your rewrite as this:
RewriteEngine On
RewriteCond %{QUERY_STRING} !(^|&)desktop=1(&|$) [NC]
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteRule ^$ http://m.example.com/ [L,R=302]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With