I want to redirect to the mobile version of the website when the request is made from Ios Browser and Successfully able to do it with following rule
RewriteCond %{HTTP_USER_AGENT} iPhone|iPod
RewriteCond %{THE_REQUEST} !(reset) [NC]
RewriteRule ^$ https://m.mydoamin1.com [L,R=302]
But I don't want to hard code my domain name here since my website is accessible from 2 domains
For Example
- mydomain1.com shud redirect to m.mydomain1.com
- mydomain2.com shud redirect to m.mydomain2.com
I'm trying to archive this with a single rule-but this doesn't work
RewriteCond %{HTTP_USER_AGENT} iPhone|iPod
RewriteCond %{THE_REQUEST} !(reset) [NC]
RewriteRule ^$ https://m.{REQUEST_URI} [L,R=302]