GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   User Agent Mobile Redirect Code (https://gfy.com/showthread.php?t=1070711)

mromro 06-07-2012 04:00 PM

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 06-08-2012 12:22 AM

wow...nobody?

BIGTYMER 06-08-2012 12:33 AM

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

So here's a bump for you.

mromro 06-08-2012 08:40 AM

Pretty Please:(

MichaelP 06-08-2012 08:49 AM

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 > :thumbsup

MikeFold 06-08-2012 09:43 AM

Quote:

Originally Posted by mromro (Post 18992745)
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 ^(.*)$ http://m.whatever.com/ [L,R=302]

from this source:
Source

Ross 06-08-2012 09:44 AM

Quote:

Originally Posted by MikeFold (Post 18994033)
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 ^(.*)$ http://m.whatever.com/ [L,R=302]

from this source:
Source

This is what we use too.

mromro 06-08-2012 09:58 AM

Thanks Guys:thumbsup I'll try too.

avrevenue 06-10-2012 08:18 PM

http://detectmobilebrowsers.com/
is up to date and available in all language


All times are GMT -7. The time now is 12:46 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc