Write the URL of your website and insert the following JS code in it. The domain will redirect to Mobile URL when the screen width is equal or less than 699px:
You can use the "user-agent" approach as well to achieve the same results. The advantage of "user-agent" detection is that you can customize for many devices.
Here’s the "user-agent" detection for iPhone and iPod:
CSS @media Method
You can use the CSS @media method for the detection of browsers. Implement two CSS @media - "screen" and "handheld" in the <head> section:
<link rel="stylesheet" href="screen.css" media="screen"/> <link rel="stylesheet" href="handheld.css" media="handheld"/>
The CSS @media rule is a built-in method used to detect mobile browsers. It displays CSS styles based on the browser window size. This does not require a separate mobile site. All you need is two style sheets within one webpage: the “screen” media type (desktop monitors) and the “handheld” media type (smartphones).