Welcome to WebmasterWorld Guest from 54.147.10.12

Forum Moderators: bakedjake

Message Too Old, No Replies

Mobile to desktop redirection code

     
6:05 pm on Apr 24, 2013 (gmt 0)

New User

joined:Apr 24, 2013
posts: 1
votes: 0


Hi

Can any one help how to redirect page to page redirection of mobile site (m.example.com) to desktop site (example.com) through htaccess file.
7:03 pm on Apr 24, 2013 (gmt 0)

Moderator from US 

WebmasterWorld Administrator travelin_cat is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 28, 2004
posts: 3115
votes: 2


Welcome to WebmasterWorld sarfarazali meghani. If I understand correctly, when someone comes to m.example.com/page1.html, you would want them to be redirected to example.com/page1.html and so on? Would this be for non mobile visitors only?

Just trying to get a handle on what you are looking to accomplish.
10:07 pm on Apr 24, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12720
votes: 244


It's exactly the same code that you're already using to redirect the "wrong" forms of your domain name-- typically with/without "www." Capture the whole request and attach it to a fresh request under a different (sub)domain name.

Frankly your much bigger problem is UA detection. It may be simpler to detect the non-mobile user agents. Anything left over is then either a robot or a mobile. You also need a way for the human user to override the redirect if that's their individual preference --or if UA detection makes a mistake, which is bound to happen sooner or later.
12:33 am on Apr 25, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 4, 2001
posts:2144
votes: 7


Can any one help how to redirect page to page redirection of mobile site (m.example.com) to desktop site (example.com) through htaccess file.


Bad idea - let the user decide.

Marshall