We support #BlackLivesMatters ! If you also support this then follow us by clicking here

iPhone redirection based on .htaccess

Chat about web technologies (IIS, Apache, etc...), hosting and server management.
Post Reply
Site Admin
Posts: 44

iPhone redirection based on .htaccess

Post by admin » Thu Aug 22, 2019 3:06 pm

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} .*iPhone.*
RewriteRule ^index\.html$ http://www.mobile.mydomain.com [L]
RewriteRule  ^/$ http://www.mydomain.com/index.html [L]
This is very old trick, now a days people are using RWD, AWD, PWA concepts for mobile version of sites. Still if you have different codebase for mobile then you can redirect like I suggested above, you can alter or add another user agent as well, thanks.

Post Reply