Forum Moderators: phranque

Message Too Old, No Replies

Mobile re-direct won’t work with CloudFare

CloudFare

         

atizen

9:33 pm on Jan 14, 2015 (gmt 0)

10+ Year Member



Hi,
I have CloudFare for one of my website. Problem is our full website (www.mywebsite) won’t re-direct to our mobile version (m.mywebsite.com) with CloudFare. Basically re-direct code won’t work. CloudFare says because of I am with their hosting partner(hostgator) they can not control the DNS.
Is there a solution for this?
Thanks

phranque

11:44 pm on Jan 14, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, atizen!

the redirect is a web server issue not a DNS issue.

Basically re-direct code won’t work.

where does the redirect code reside and what does it look like?

atizen

1:08 am on Jan 15, 2015 (gmt 0)

10+ Year Member



Hi Phranque,
here is the re-direct code;
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ [example.com...] [R=301,L]
RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "mini|nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "blackberry|ericsson,|panasonic|philips|sanyo|sharp|sie-"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic,|alcatel|ericy|vodafone\/|wap1\.|wap2\.|iPhone|android"[NC]
RewriteRule ^(.+)\$ http://m.example.com/$1 [R=302,NC]

i am using this code for other websites i have and i don't have any problem with those. But somehow CloudFare refuses to re-direct mobile users to mobile website.

Thanks for your reply,,,,

[edited by: phranque at 11:36 pm (utc) on Jan 21, 2015]
[edit reason] Please Use example.com [webmasterworld.com] [/edit]

atizen

2:47 pm on Jan 21, 2015 (gmt 0)

10+ Year Member



looks like this forum is dead ,,,

lucy24

8:00 pm on Jan 21, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What User-Agent string is sent by requests that come in through CloudFlare?


Incidentally...
wap1\.|wap2\.

=
wap[12]\.


up\.browser|up\.link

=
up\.(browser|link)

phranque

11:35 pm on Jan 21, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



looks like this forum is dead

sorry - i missed your reply.

What User-Agent string is sent by requests that come in through CloudFlare?

what she said...