How to redirect to mobile site
Redirect to mobile site because its easy! So you have your website set up and a mobile friendly site but you still need to redirect to mobile site. What we can do is use java script to figure out what size screen the user is using. If they surfer is using a smaller browser like that on a tablet or a cell phone we may want to redirect that person to out mobile site. I have included a script here that you should put in your head tags on your website. Now you can use this script to also point anyone with a smaller browser to any site that you wish but we will assume that you just want to direct them to another part of your website. Here is what the script looks like. In this script we are redirecting everyone that has a screen size 699 pixels or smaller to another part of our website. I also included an iPhone redirect script to tell iPhones where to go and it does not matter what their screen size is, lol.
If you need lessons on how to edit php please visit our lessons page.
Please like, share and subscribe.
I hope you enjoyed the article. If I was able to help you please consider a tip for the content.
One Time Tip