Redirect for Mobile Users

I have seen that many companies have a mobile version of their website. Often it is instead of

When you visit their site, it redirects you to the mobile site when you are on your smartphone.

How is this accomplished?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

William FulksSystems Analyst & WebmasterCommented:
InMotion Hosting has a brief tutorial on the subject here -

However, as an alternative you may consider looking into creating a responsive website where Div's collapse and rearrange based on browser width. It's a little more complicated to build BUT it keeps you from having to maintain two different sites.
David Johnson, CD, MVPOwnerCommented:
your browser shows a lot of information via the user agent and items that can be queried via javascript like your screen dimensions. if the browser is a 'mobile' browser or the screen dimensions are smaller than a specified size then the site is redirected to the mobile version.
GenesisTechAuthor Commented:

Do you have any sample ASP code showing how to use the user agent?
David Johnson, CD, MVPOwnerCommented:
ub is_mobile()
  Dim Regex, match
  Set Regex = New RegExp
     With Regex
        .Pattern = "(up.browser||mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm|ipad)"
        .IgnoreCase = True
        .Global = True
      End With
   match = Regex.test(Request.ServerVariables("HTTP_USER_AGENT"))
   If match
      return True
      return False
   End If
End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GenesisTechAuthor Commented:
Thank you David!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Responsive Web

From novice to tech pro — start learning today.