Skip to content
Advertisement

Redirecting non Safari mobile browser?

I am looking for assistance with coding to detect and redirect a iOS user on any browser other than Safari. I was able to accomplish this via .htaccess, but for iPhone & iPad redirect only, via this:

JavaScript

But, I only intend it for non-Safari iOS browsers on iPhone and iPad. Open to other methods than htaccess. Our WebRTC script only works on Safari.

Advertisement

Answer

If you have not found a solution, you can test this:

JavaScript

First we check if we are using iphone|ipad, the second directive detects safari. But chrome presents also with name safari, we exclude CriOS for Google Chrome and OPiOS for Opera, so we have True safari, we run /safari-with-webrtc.php.

Otherwise, we are not on iPhone|iPad with Safari, we run /ios-without-webrtc.php.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement