Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
06-02-2015, 02:16 AM | #1 |
Registered User
Industry Role:
Join Date: Jun 2014
Posts: 61
|
Good htaccess mobile redirect code?
Can somebody help me with an "uptodate" mobile redirect code for .htaccess?
I did google it, but theres to much crap out there.
__________________
Mike Glass Icq: 652387948 |
06-02-2015, 03:18 AM | #2 |
Confirmed User
Industry Role:
Join Date: Jun 2013
Posts: 244
|
RewriteEngine On
RewriteRule \.(jpg|png|gif|jpeg|bmp)$ - [L] RewriteCond %{HTTP_USER_AGENT} (mobile|android|blackberry|brew|cldc|docomo|htc|j2 me|micromax|lg|midp|mot|motorola|netfront|nokia|ob igo|openweb|opera.mini|palm|psp|samsung|sanyo|sch| sonyericsson|symbian|symbos|teleca|up.browser|voda fone|wap|webos|windows.ce) [NC] RewriteRule ^(.*)$ http:// yoururl. com [R=302,L] |
06-02-2015, 08:24 AM | #3 |
PsyHead
Industry Role:
Join Date: Aug 2005
Location: Hungary
Posts: 8,631
|
this is a good code gebu posted, but don't do this. Get your mobile traffic a proper landing page On Your Site. Otherwise Google will fuck your site's ass.
__________________
-=- Register with our ref link and we help you with the setup! -=-
AdSpyglass.com - Double your profit from brokers |
06-02-2015, 08:43 AM | #4 | |
Registered User
Industry Role:
Join Date: Aug 2011
Posts: 37
|
Quote:
No Need to redirect.I got what you need. Please ping me on skype. skype id CPRenato |
|
06-02-2015, 11:12 AM | #5 |
Bye - Left to do stuff
Industry Role:
Join Date: Feb 2013
Posts: 4,109
|
|
06-02-2015, 03:09 PM | #6 |
Confirmed User
Industry Role:
Join Date: Sep 2005
Posts: 2,361
|
Use mobile pop code, dont use mobile redirect
__________________
Best banners/native ads and POPUPS with no any shit - Exoclick Selling quality hardlinks/menu tabs/contextual links: from good aged sites contact email:mastermich {here} gmail In com |
06-02-2015, 03:13 PM | #7 | |
Confirmed User
Industry Role:
Join Date: Aug 2005
Location: YUROP
Posts: 8,537
|
Quote:
. . .
__________________
Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo! Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here |
|
06-02-2015, 04:25 PM | #8 |
Confirmed User
Industry Role:
Join Date: Feb 2007
Posts: 6,904
|
|
06-02-2015, 11:29 PM | #9 |
Registered User
Industry Role:
Join Date: Jun 2014
Posts: 61
|
Thanks for the code!
Its for redirecting the mobile traffic to the .m version of the same website.
__________________
Mike Glass Icq: 652387948 |
06-02-2015, 11:44 PM | #10 | |
PsyHead
Industry Role:
Join Date: Aug 2005
Location: Hungary
Posts: 8,631
|
Quote:
<?php if(! empty($_SERVER['HTTP_USER_AGENT'])){ $useragent = $_SERVER['HTTP_USER_AGENT']; if( preg_match('@(iPad|iPod|iPhone|Android|BlackBerry| SymbianOS|SCH-M\d+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS)@', $useragent) ){ header('Location: ./mobile/'); } } ?> This redirects users to domain.com/mobile But you can also determine a screen width in css to show the mobile site if the width is smaller than xxx pixels... Not sure how this works, but others will help to finetune this method
__________________
-=- Register with our ref link and we help you with the setup! -=-
AdSpyglass.com - Double your profit from brokers |
|
06-03-2015, 08:15 AM | #11 |
Confirmed User
Join Date: Nov 2001
Posts: 1,662
|
Can also make CSS changes by screen width:
Code:
@media only screen and (max-width: 1440px) { } /* small desktop */ @media only screen and (max-width: 1280px) { } /* laptop */ @media only screen and (max-width: 1024px) { } /* tablet landscape */ @media only screen and (max-width: 768px) { } /* tablet portrait */ @media only screen and (max-width: 480px) { } /* mobile landscape */ @media only screen and (max-width: 320px) { } /* mobile portrait */ |
06-03-2015, 08:25 AM | #12 |
Confirmed User
Industry Role:
Join Date: Jun 2012
Location: Canada
Posts: 1,338
|
Just go there and grab the one you need:
Detect Mobile Browsers - Open source mobile phone detection |
06-03-2015, 10:13 AM | #13 |
PsyHead
Industry Role:
Join Date: Aug 2005
Location: Hungary
Posts: 8,631
|
Listen to HowlingWulf
__________________
-=- Register with our ref link and we help you with the setup! -=-
AdSpyglass.com - Double your profit from brokers |