Created
July 6, 2012 12:42
-
-
Save henriqueboaventura/3059972 to your computer and use it in GitHub Desktop.
PHP mobile redirect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (preg_match('/(iphone|android|webos|blackberry|ipod|ipad|mobile)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) { | |
header('Location: http://m.site.com/index.php?id='.$HTTP_GET_VARS["id"]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment