Help! Redirect Users Who Have Mobile Devices

Discussion in 'Black Hat SEO' started by CashDummy, Feb 17, 2017.

  1. CashDummy

    CashDummy Regular Member

    Joined:
    Oct 3, 2007
    Messages:
    219
    Likes Received:
    93
    Home Page:
    Is there a code I can use to send people who go to my site using a mobile device to a different link?
     
  2. MatthewGraham

    MatthewGraham Jr. VIP Jr. VIP

    Joined:
    Oct 6, 2015
    Messages:
    1,583
    Likes Received:
    1,822
    Gender:
    Male
    Occupation:
    Rolling Face on Keyboard
    Location:
    United States of America
    Home Page:
  3. CashDummy

    CashDummy Regular Member

    Joined:
    Oct 3, 2007
    Messages:
    219
    Likes Received:
    93
    Home Page:
    I looked on google before I asked here and after many clicks none of appeared to work so I came up with this.
    Code:
    <meta HTTP-EQUIV="REFRESH" content="0; url=https://Mysite.com=">
    <script type="text/javascript">
    <!--
    if (screen.width <= 1000) {
    window.location = "https://MysiteForMobile.com";
    }
    //-->
    </script>
    works like a charm!

    Hope this will help anyone else
     
  4. samdcoolest

    samdcoolest Newbie

    Joined:
    May 17, 2014
    Messages:
    22
    Likes Received:
    1
    Thanks for the code. I used to achieve this using the tracker Voluum back in the day.
     
  5. lovejesus

    lovejesus Regular Member

    Joined:
    Jul 28, 2013
    Messages:
    200
    Likes Received:
    25
    Occupation:
    Freelancer
    Location:
    UK
    Javascript method is not reliable. use php snippet instead.
    code is mentioned below
    PHP:
    <?php
    require_once 'Mobile_Detect.php';
    $detect = new Mobile_Detect;

    if(
    $detect->isMobile()) {
       
    header('Location: http://mobile.example1.com/'); // url of your mobile site or any different link
       
    exit;
    }
    the content of Mobile_Detect.php is here https://github.com/serbanghita/Mobile-Detect/blob/master/Mobile_Detect.php

    This is very fast as compared to javascript method