Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 313
  • Last Modified:

Redirect mobile devices to a different URL?

Hi Experts,

I want to redirect my site if user using mobile redirect mobile link and if using pc or tablet redirect normal view..

It's possible to do in my html or using js? Plz guide me experts.

Thanks
0
codeoxygen
Asked:
codeoxygen
1 Solution
 
Jagadishwor DulalBraces MediaCommented:
Use javascript in the head section of your mainpage :
<script type="text/javascript">
  <!--
  if (screen.width <= 800) {
//Use your screen size for mobile here I am posting for <=800
    window.location = "http://m.yoursite.com";
  }
  //-->
</script>

Open in new window

0
 
leakim971PluritechnicianCommented:
check this too : http://jsfiddle.net/3jeMe/2/
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now