redirect mobile users (ipad and android) to a m.domain.com?
5 posts
• Page 1 of 1
redirect mobile users (ipad and android) to a m.domain.com?
Hi,
beginner question.. would it be possible to redirect (only) the mobile users to a different subdomain using rewrite3 on iis6?
im not quite sure how to do it but it seems todo with user-agent header and searching for 'midp|mobile|phone|android|iphone|ipad'
anyone know how to do this?
beginner question.. would it be possible to redirect (only) the mobile users to a different subdomain using rewrite3 on iis6?
im not quite sure how to do it but it seems todo with user-agent header and searching for 'midp|mobile|phone|android|iphone|ipad'
anyone know how to do this?
Re: redirect mobile users (ipad and android) to a m.domain.c
could it be like this ?
idea is to take all mobile users to m.domain.com
- Code: Select all
RewriteCond %{HTTP:User-Agent} (midp|mobile|phone|android|iphone|ipad)
RewriteRule (.*) http://m.domain.com
idea is to take all mobile users to m.domain.com
Re: redirect mobile users (ipad and android) to a m.domain.c
Yes, your code is good. Let's make it a little more precise like this:
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} (?:midp|mobile|phone|android|iphone|ipad) [NC]
RewriteRule (.*) http://m.domain.com/$1 [R=301,L]
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} (?:midp|mobile|phone|android|iphone|ipad) [NC]
RewriteRule (.*) http://m.domain.com/$1 [R=301,L]
Re: redirect mobile users (ipad and android) to a m.domain.c
thank you for helping me, and making things even better.
not quite understand one part of the RewriteRule : '$1 [R=301,L]
Does it have something to do with keeping the postfix URL? like http://www.domain.com/$1 to m.domain.com/$1 for example: http://www.domain.com/game/play.php to http://m.domain.com/game/play.php ?
in my case i rather have all mobiel users to land exactly on http://m.domain.com no matter the URL location, because all my content is no use for them (its a flash game website)
Would it be like this in my case? should [R=301,L] be kept in the rule or not?..
not quite understand one part of the RewriteRule : '$1 [R=301,L]
Does it have something to do with keeping the postfix URL? like http://www.domain.com/$1 to m.domain.com/$1 for example: http://www.domain.com/game/play.php to http://m.domain.com/game/play.php ?
in my case i rather have all mobiel users to land exactly on http://m.domain.com no matter the URL location, because all my content is no use for them (its a flash game website)
Would it be like this in my case? should [R=301,L] be kept in the rule or not?..
- Code: Select all
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} (?:midp|mobile|phone|android|iphone|ipad) [NC]
RewriteRule (.*) http://m.domain.com
Re: redirect mobile users (ipad and android) to a m.domain.c
If you want all requests to land on the home page, then your config is correct, but I suggest leaving [R=301,L]:
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} (?:midp|mobile|phone|android|iphone|ipad) [NC]
RewriteRule (.*) http://m.domain.com [R=301,L]
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} (?:midp|mobile|phone|android|iphone|ipad) [NC]
RewriteRule (.*) http://m.domain.com [R=301,L]
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 14 guests