terryds Posted May 19, 2013 Share Posted May 19, 2013 (edited) I want to make a site that automatically redirects to subdomain m.mysite.com ?I mean, i want to make a site that has two versions, one for desktop (without subdomain m. ) and one for mobile phones (with subdomain m.)When the user goes to mysite.com using his mobile phone, he will be directed to m.mysite.com.. (like facebook) Can you tell me how to do that? Edited May 19, 2013 by terryds Link to comment Share on other sites More sharing options...
Ingolme Posted May 19, 2013 Share Posted May 19, 2013 Probably looking at the User-Agent header and comparing it to a list of mobile devices. You can read the user agent with PHP $_SERVER['HTTP_USER_AGENT'] I'd search on Google for a list of the user agent strings of mobile devices. Link to comment Share on other sites More sharing options...
thescientist Posted May 19, 2013 Share Posted May 19, 2013 I would advocate using responsive design instead. Twitter has a nice framework for that.http://twitter.github.io/bootstrap/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now