Reputation: 253
My question today is how may I redirect a Ipad user to a different website. For Iphone/Ipod It was simple:
<script language=javascript>
<!--
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
location.replace("#");
}
-->
</script>
What I want to do be able to do the same but on Ipad/Ipad Mini. Is it possible?
Upvotes: 0
Views: 117
Reputation: 1339
I don't know about iPad mini but for iPad you can use this
navigator.userAgent.match(/iPad/i)
you can also write a rule in .htaccess:
RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$
RewriteRule ^(.*)$ http://domain.com [R=301]
Upvotes: 1