.htaccess mobile redirection (Help!)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex.missyouth
    Confirmed User
    • Sep 2012
    • 1870

    #1

    .htaccess mobile redirection (Help!)

    Hello guys,

    I really hope someone here could help me with this problem.

    I need to add an exception to our mobile redirect rules, more precisely, I need to exclude a URL that contains a certain pattern from mobile redirection.

    How can I accomplish this?

    Part of my .htaccess file looks like this...

    RewriteEngine On

    RewriteCond %{HTTP_USER_AGENT} (mobile|android|blackberry|brew|htc|j2me|lg|midp|m ot|netfront|nokia|obigo|openweb|opera\ mini|palm|psp|samsung|sanyo|sch|sonyericsson|symbi an|symbos|teleca|up\.browser|wap|webos|windows\ ce) [NC]
    I tried a few solutions with no luck, I added the following line before the line quoted but it didn't help. What am I missing here?

    RewriteCond %{REQUEST_URI} !^/gallery/*$
    skype: descargasweb
  • VladS
    Available for Coding Work
    • Jun 2008
    • 1459

    #2
    Just use PHP and grab the code from here -> http://detectmobilebrowsers.com/
    <developer> MechBunny / KVS / PHP / MySQL / HTML5 / CSS3 / jQuery
    Email: vlad [at] dangerouscoding.com
    Telegram: @dangerouscoding

    Comment

    • AllAboutCams
      Femcams.com
      • Jul 2011
      • 12234

      #3
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
      </IfModule>
      RewriteEngine On
      RewriteCond %{HTTP_USER_AGENT} "iphone|ipod|android" [NC]
      RewriteCond %{HTTP_HOST} !^m.bookofzeus.com
      RewriteRule ^(.*)$ http://yourwebsite.com [L,R=302]
      Binance - Blockchain and Crypto Asset Exchange
      Chaturbate make money in cams

      Comment

      • Barry-xlovecam
        It's 42
        • Jun 2010
        • 18083

        #4
        Code:
        RewriteEngine On
        
        #RewriteCond %{HTTP_USER_AGENT} (mobile|android|blackberry|brew|cldc|docomo|htc|j2me|micromax|lg|midp|mot|motorola|netfront|nokia|obigo|openweb|opera.mini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|vodafone|wap|webos|windows.ce) [NC]
        #RewriteRule ^(.*)$ http://mobile.xlovecam.com/?id_affilie=1272&ids=1&p=mobile [R=302,L]
        
        
        ####MOBILE
        remove # comments

        Comment

        • Zeiss
          Confirmed User
          • May 2012
          • 5189

          #5
          apache redirect to mobile

          Code:
          RewriteEngine On
          RewriteCond %{HTTP_USER_AGENT} iphone|ipod|android [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} up\.browser|up\.link|windows\ ce|iemobile|mini|mmp\|symbian|smartphone|midp|wap|teleca|vodafone|o2|[^i]phone|pocket|kindle|mobile|treo|psp [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^(1207|3gso|4thp|501i|502i|503i|504i|505i|506i|6310|6590|770s|802s|a\ wa|acer|acs\-|airn|alav|asus|attw|au\-m|aur\ |aus\ |abac|acoo|aiko|alco|alca|amoi|anex|anny|anyw|aptu|arch|argo|bell|bird|bw\-n|bw\-u|beck|benq|bilb|blac|c55\/|cdm\-|chtm|capi|comp|cond|craw|dall|dbte|dc\-s|dica|ds\-d|ds12|dait|devi|dmob|doco|dopo|el49|erk0|esl8|ez40|ez60|ez70|ezos|ezze|elai|emul|eric|ezwa|fake|fly\-|fly\_|g\-mo|g1\ u|g560|gf\-5|grun|gene|go\.w|good|grad|hcit|hd\-m|hd\-p|hd\-t|hei\-|hp\ i|hpip|hs\-c|htc\ |htc\-|htca|htcg|htcp|htcs|htct|htc\_|haie|hita|huaw|hutc|i\-20|i\-go|i\-ma|i230|iac\-|iac\/|ig01|im1k|inno|iris|jata|java|kddi|kgt\/|kpt\ |kwc\-|klon|lexi|lg\ g|lg\-a|lg\-b|lg\-c|lg\-d|lg\-f|lg\-g|lg\-k|lg\-l|lg\-m|lg\-o|lg\-p|lg\-s|lg\-t|lg\-u|lg\-w|lg\/k|lg\/l|lg\/u|lg50|lg54|lge\-|lge\/|lynx|leno|m1\-w|m3ga|m50\/|maui|mc01|mc21|mcca|medi|meri|mio8|mioa|mo01|mo02|mode|modo|mot\ |mot\-|mt50|mtp1|mtv\ |mate|maxo|merc|mits|mobi|motv|mozz|n100|n101|n102|n202|n203|n300|n302|n500|n502|n505|n700|n701|n710|nec\-|nem\-|newg|neon|netf|noki|nzph|o2\ x|o2\-x|opwv|owg1|opti|oran|p800|pand|pg\-1|pg\-2|pg\-3|pg\-6|pg\-8|pg\-c|pg13|phil|pn\-2|pt\-g|palm|pana|pire|pock|pose|psio|qa\-a|qc\-2|qc\-3|qc\-5|qc\-7|qc07|qc12|qc21|qc32|qc60|qci\-|qwap|qtek|r380|r600|raks|rim9|rove|s55\/|sage|sams|sc01|sch\-|scp\-|sdk\/|se47|sec\-|sec0|sec1|semc|sgh\-|shar|sie\-|sk\-0|sl45|slid|smb3|smt5|sp01|sph\-|spv\ |spv\-|sy01|samm|sany|sava|scoo|send|siem|smar|smit|soft|sony|t\-mo|t218|t250|t600|t610|t618|tcl\-|tdg\-|telm|tim\-|ts70|tsm\-|tsm3|tsm5|tx\-9|tagt|talk|teli|topl|tosh|up\.b|upg1|utst|v400|v750|veri|vk\-v|vk40|vk50|vk52|vk53|vm40|vx98|virg|vite|voda|vulc|w3c\ |w3c\-|wapj|wapp|wapu|wapm|wig\ |wapi|wapr|wapv|wapy|wapa|waps|wapt|winc|winw|wonu|x700|xda2|xdag|yas\-|your|zte\-|zeto|aste|audi|avan|blaz|brew|brvw|bumb|ccwa|cell|cldc|cmd\-|dang|eml2|fetc|hipt|http|ibro|idea|ikom|ipaq|jbro|jemu|jigs|keji|kyoc|kyok|libw|m\-cr|midp|mmef|moto|mwbp|mywa|newt|nok6|o2im|pant|pdxg|play|pluc|port|prox|rozo|sama|seri|smal|symb|treo|upsi|vx52|vx53|vx60|vx61|vx70|vx80|vx81|vx83|vx85|wap\-|webc|whit|wmlb|xda\-) [NC,OR]
          RewriteCond %{HTTP_ACCEPT} text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml [NC,OR]
          RewriteCond %{HTTP:HTTP_X_WAP_PROFILE} .+ [OR]
          RewriteCond %{HTTP:HTTP_PROFILE} .+ [OR]
          RewriteCond %{HTTP:X-OperaMini-Features} .+ [OR]
          RewriteCond %{HTTP:UA-pixels} .+
          RewriteRule .* http://yoursite.tld [R=302,L]
          Originally posted by alex.missyouth
          What am I missing here?

          RewriteCond %{REQUEST_URI} !^/gallery/*$
          you are missing a period

          to remove url from redirect
          Code:
          #activate this rule to exclude a directory from redirects
          #RewriteCond %{REQUEST_URI} !^/folder/.*$
          Last edited by Zeiss; 06-11-2013, 08:49 AM.


          Adult Webmasters Guides

          Comment

          • alex.missyouth
            Confirmed User
            • Sep 2012
            • 1870

            #6
            Big thx for the answers guys.

            I'm working on this now, I'll let you know how it goes.
            skype: descargasweb

            Comment

            • Zeiss
              Confirmed User
              • May 2012
              • 5189

              #7
              Originally posted by alex.missyouth
              Big thx for the answers guys.

              I'm working on this now, I'll let you know how it goes.
              I think it is because of the period, man. Let me know, if that's it. I need to know. :D


              Adult Webmasters Guides

              Comment

              • alex.missyouth
                Confirmed User
                • Sep 2012
                • 1870

                #8
                Originally posted by Zealotry
                I think it is because of the period, man. Let me know, if that's it. I need to know. :D
                Woow, it was the period, damn I was really close. =)

                Thanks man for pointing it out for me. I appreaciate it, hope this helps you too. ;)
                Last edited by alex.missyouth; 06-11-2013, 11:28 AM.
                skype: descargasweb

                Comment

                • Zeiss
                  Confirmed User
                  • May 2012
                  • 5189

                  #9
                  Originally posted by alex.missyouth
                  Woow, it was the period, damn I was really close. =)

                  Thanks man for pointing it out for me. I appreaciate it, hope this helps you too. ;)


                  Adult Webmasters Guides

                  Comment

                  • RyuLion
                    • Mar 2003
                    • 32369

                    #10
                    Oh nice! thanks for that code!

                    Adult Biz Consultant A tech head since 1995
                    Affiliate Support: Chaturbate | CCBill Live

                    Comment

                    Working...