1

I understand that I need to use parameters of measure and other loading shortcuts to make the site load fast for mobile, it's not building the mobile site itself that troubles me.

I need to have a code that shows the browser where to redirect if a mobile phone goes onto the site.

I need to know how to implement it too, I only write html and css, I need a FULL SNIPPET. I've done a tone of research and plenty of coder have given their advice on methods of detection, but haven't said HOW TO implement those methods.

Kara
  • 6,115
  • 16
  • 50
  • 57
Jer
  • 11
  • 7

1 Answers1

1

You have two options.

First option is to make Responsive Website, which aligns itself depending on device screen size. For example, if your screen width is lower than 400px you can act like it is mobile, and arrange your website. Like in this image. You can also check this website, try to change your browser size, make it smaller : http://www.smashingmagazine.com/

Responsive website

Second option is to use some script code to detect if the device is mobile(if it is mobile, which OS, which browser it uses etc.) and redirect users to other mobile site. For example you can deploy a mobile site in a subdomain like this http://mobile.example.com

First option is more complicated because you have to spend time arranging screen sizes and fitting your content in it, but it is getting popular. Second option is more easier, because you will have two websites and redirect users to one of them depending on device they use.

Gokhan Arik
  • 2,626
  • 2
  • 24
  • 50
  • I already put in my question both that I have no trouble designing the site and that I needed to obtain the code to redirect, you have not answered my question. – Jer Jul 11 '13 at 17:46
  • @dannyroa answered in comment, that's why I didn't say anything about it. This website has code to detect mobile device, http://detectmobilebrowsers.com/ You can download JavaScript version of it and put to your website. In the code there is a url at the bottom `http://detectmobilebrowser.com/mobile` change it to your mobile website url – Gokhan Arik Jul 11 '13 at 18:44
  • And some more information here : http://stackoverflow.com/questions/11381673/javascript-solution-to-detect-mobile-browser – Gokhan Arik Jul 11 '13 at 18:47
  • Check and let me know,I have done this long time ago this should solve your problem, I have also used same JS code – Gokhan Arik Jul 11 '13 at 19:34