User Agent Mobile Redirect Code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mromro
    So Fucking Banned
    • Jan 2011
    • 770

    #1

    User Agent Mobile Redirect Code

    Anyone care to share their mobile redirect code for .htaccess?
    I don't think the one I am useing now is detecting all the devices.
  • mromro
    So Fucking Banned
    • Jan 2011
    • 770

    #2
    wow...nobody?

    Comment

    • BIGTYMER
      Junior Achiever
      • Nov 2004
      • 17066

      #3
      I'm not at my computer or I'd share mine.

      So here's a bump for you.

      Comment

      • mromro
        So Fucking Banned
        • Jan 2011
        • 770

        #4
        Pretty Please

        Comment

        • MichaelP
          Registered User
          • Aug 2003
          • 7124

          #5
          You can try this in PHP :

          Weorks good for me


          **?
          IF (strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod'))
          {
          header('Location:YOUR-URL-FOR-IPOD-AND-IPHONE');
          exit();
          } ELSE IF (strstr($_SERVER['HTTP_USER_AGENT'],'iPad'))
          {
          header('Location: YOUR-URL-FOR-IPAD');
          exit();
          }
          ?**

          ** = < and >

          Comment

          • MikeFold
            Confirmed User
            • Nov 2001
            • 465

            #6
            Originally posted by mromro
            Anyone care to share their mobile redirect code for .htaccess?
            I don't think the one I am useing now is detecting all the devices.
            here is one i use:

            Code:
            #HTACCESS MOBILE SITE REDIRECTION CODE
            RewriteEngine On
            RewriteCond %{HTTP_USER_AGENT} (opera\ mini|ipod|iphone|up\.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|pda|psp|treo|nokia|blackberry|android) [NC]
            RewriteCond %{HTTP_HOST} !^m.whatever.com
            RewriteRule ^(.*)$ [url]http://m.whatever.com/[/url] [L,R=302]
            from this source:
            Source
            nothing to promote

            Comment

            • Ross
              Ik ben een aap
              • Sep 2002
              • 18874

              #7
              Originally posted by MikeFold
              here is one i use:

              Code:
              #HTACCESS MOBILE SITE REDIRECTION CODE
              RewriteEngine On
              RewriteCond %{HTTP_USER_AGENT} (opera\ mini|ipod|iphone|up\.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|pda|psp|treo|nokia|blackberry|android) [NC]
              RewriteCond %{HTTP_HOST} !^m.whatever.com
              RewriteRule ^(.*)$ [url]http://m.whatever.com/[/url] [L,R=302]
              from this source:
              Source
              This is what we use too.

              Comment

              • mromro
                So Fucking Banned
                • Jan 2011
                • 770

                #8
                Thanks Guys I'll try too.

                Comment

                • avrevenue
                  Confirmed User
                  • Apr 2004
                  • 1904

                  #9
                  http://detectmobilebrowsers.com/
                  is up to date and available in all language
                  AV Revenue High Quality Sites to Promote
                  Telegram: avrevenue

                  Comment

                  Working...