iPhone , iPad, iPod web redirection

redirect iPhone, iPad and iPod users to a smart phone friendly site. Thanks to http://www.htaccesstools.com DETECT AND REDIRECT IPHONE Use iPhone detection and redirection to target your iPhone users. So you want detect iPhone users on your website and redirect them to a specific page or version of your site. Here is how to redirect iPhone traffic with .htaccess: RewriteEngine on RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule .* http://iphone.example.com/ [R] The code will redirect iPhone users to a iPhone specific site on iphone.example.com. Or if you want to redirect to a sub directory of your site, ie example.com/my-iPhone-site/, you should use the following code: RewriteEngine on RewriteCond %{HTTP_USER_AGENT} iPhone RewriteCond %{REQUEST_URI} !^/my-iPhone-site/ RewriteRule .* /my-iPhone-site/ [R] Thanks to Steve Stedman for this tip. How iPhone detection and redirection works The htaccess code works by examining the HTTP header “User-Agent” which all browser send. iPhone sends a User-Agent header similar to this one: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C25 Safari/419.3 As you can see the text contains “iPhone”, and thats how you know its an iPhone user.
  • 0 Benutzer fanden dies hilfreich
War diese Antwort hilfreich?

Related Articles

HASH & PASSWORD CONVERTORS

Generates passwords and hasheshttp://hash.online-convert.com/sha1-generatorCracks Password...

iPad redirect using .htaccess

RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$ RewriteRule ^(.*)$...

.htaccess information

A good source of tools and info. http://www.htaccesstools.com

.htaccess REDIRECTION RULES

REDIRECTION Learn how to perform temporary redirection and permanent redirection using PHP,...

REDIRECT A WEBPAGE WITH HTML CODE

Place this code in between the section of your webpage. The content number is the number of...