DevOps
Linux Systems Engineer
- Joined
- Oct 18, 2019
- Messages
- 192
- Reaction score
- 17
- Points
- 18
- Location
- Novosibirsk, Russia
- Website
- addons.vevioz.com
Offline
Use the code 1:
And code 2:
And code 3:
301 redirects
Code:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} (iphone|ipad|android|blackberry|windows\ phone) [NC]
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^ http://m.example.com
And code 2:
Code:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !(iphone|ipad|android|blackberry|windows\ phone) [NC]
RewriteCond %{HTTP_HOST} ^m\.example\.com$ [NC]
RewriteRule ^ http://www.example.com
And code 3:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301,NC]
RewriteCond %{HTTP_USER_AGENT} (iphone|ipad|android|blackberry|windows\ phone) [NC]
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^ http://m.domain.com
301 redirects