1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect Users Who Have Mobile Devices

Discussion in 'Scripting' started by CashDummy, Feb 17, 2017.

  1. CashDummy

    CashDummy Jr. VIP Jr. VIP

    Joined:
    Oct 3, 2007
    Messages:
    220
    Likes Received:
    94
    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. chillerfx

    chillerfx Jr. VIP Jr. VIP

    Joined:
    Mar 20, 2012
    Messages:
    241
    Likes Received:
    63
    Occupation:
    Graphic Designer, Web-dev and Digital Marketer.
    Location:
    Everywhere on net.
    Home Page:
  3. Turkhero

    Turkhero Newbie

    Joined:
    Nov 30, 2016
    Messages:
    21
    Likes Received:
    3
    Gender:
    Male
    Mobiledetect.net is great
     
  4. David Jones

    David Jones Regular Member

    Joined:
    Jan 31, 2017
    Messages:
    277
    Likes Received:
    42
    Gender:
    Male
    Location:
    New York
    Home Page:
    you can use this
    Code:
    RewriteEngine On
    # Check for mime types commonly accepted by mobile devices
    RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC]
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^ http://m.domain.com%{REQUEST_URI} [R,L]
     
  5. epagos

    epagos Newbie

    Joined:
    Apr 11, 2007
    Messages:
    22
    Likes Received:
    1
    I have used "mobile-detect.js", seems to work fine, You can find it on github.