Creating links to assorted web pages with dual URLs. in JavaScript Posted October 18, 2015 Try with server side Solution in PHP, if is Mobile you write the mobile link, else you write the normal link. <?phpfunction isMobile() {return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up.browser|up.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);}?> When you write a link, insert <a href="<?php if(isMobile()){ echo 'http://mobilelink.it'; } else{ echo 'http://normal-link.it'; } ?>">My awesome link</a>
Creating links to assorted web pages with dual URLs.
in JavaScript
Posted
Try with server side Solution in PHP, if is Mobile you write the mobile link, else you write the normal link.
When you write a link, insert