Created
June 7, 2011 16:45
-
-
Save revolunet/1012638 to your computer and use it in GitHub Desktop.
tablet detection (android/ipad)
This file contains hidden or 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
| # | |
| # redirect requests if not iPad or Android tablet | |
| # NB "mobile safari" is the UA for Android phones | |
| # | |
| RewriteEngine On | |
| SetEnv isAndroidTablet=NO | |
| BrowserMatchNoCase Android isAndroidTablet=YES | |
| BrowserMatchNoCase "Mobile Safari" isAndroidTablet=NO | |
| # reject iphones, ipods, android mobiles flavours for main domain | |
| RewriteCond %{HTTP_HOST} ^mobile\.revolunet\.com [NC] | |
| RewriteCond %{HTTP_USER_AGENT} !^.*ipad.*$ [NC] | |
| RewriteCond %{ENV:isAndroidTablet} !=YES | |
| # exclude some IP | |
| # RewriteCond %{REMOTE_ADDR} !128.128.128.128 | |
| RewriteRule (.*) http://www.revolunet.com [L] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment