I am developing mobile websites and I can redirect mobile visitors to mobile version properly, using one of the three methods: JavaScript, .htaccess and PHP.
At this time, I use .htaccess because not all the mobile devices support JavaScript and it might be disabled by the user. Also, not all the websites are coded in PHP, that's why I cannot use PHP redirect for all cases.
and here is my .htaccess code:
RewriteEngine on RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|andr|audi|aumi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "dang|doco|elai|epoc|eric|hipt|htc|inno|ipad|ipaq|ipho|j2me|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "maui|maxo|mda|midp|mini|mits|mmef|mobi|mot-|moto|mwbp|nec-|netf|newt|noki|oper|opwv" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pda|pdxg|phil|play|pluc|pock|port|prox|qtek|qwap|rove|sage|sams|sany" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "sch-|sda|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windows ce|windowssce|iemobile|mini|mmp" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC] RewriteRule (.*) http://mobileversion.com/ [R,L]Now I have a "View Full Site" link on the mobile site and I want to send visitors to the full site, if they click that link. Is there a way to do this using only .htaccess (without PHP)? If not, how can I do this with PHP?