Gary
Premium Member
Registered: 22nd Nov 06
Location: West Yorkshire
User status: Offline
|
Need to redirect mobile users to the mobile version of our website
How's it done?
|
Whittie
Member
Registered: 11th Aug 06
Location: North Wales Drives: BMW, Corsa & Fiat
User status: Offline
|
I told Si this last week, did he not sort it out?
You're re-directing iphones only aren't you, as the site was flash?
|
Gary
Premium Member
Registered: 22nd Nov 06
Location: West Yorkshire
User status: Offline
|
And android. It'll be hard to navigate on any device.
all he said it was something to do with the htacces but that was it
|
Whittie
Member
Registered: 11th Aug 06
Location: North Wales Drives: BMW, Corsa & Fiat
User status: Offline
|
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^siteurltoredirect$ http://theendpointurl.com [R,L]
Just bang that in it, covers 99% of UK phones, so should be alright if you're usin... m.theendpointurl.com its different though, theres a tut somewhere. Let me know if you need it
|
Gary
Premium Member
Registered: 22nd Nov 06
Location: West Yorkshire
User status: Offline
|
redireted url will just be the normal url/mobile
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
http://detectmobilebrowsers.mobi/download/
|
Gary
Premium Member
Registered: 22nd Nov 06
Location: West Yorkshire
User status: Offline
|
Pay via twitter or bookface?
not got either
|
Nismo
Member
Registered: 12th Sep 02
User status: Offline
|
quote: Originally posted by ed
http://detectmobilebrowsers.mobi/download/
I use this works perfectly, you can direct different OS users to different versions to optimise iPhone users etc...
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
Use htaccess and have a look at http://stackoverflow.com/questions/3680463/mobile-redirect-using-htaccess.
$40p/y seems a bit steep for something that essentially can be done for free.....
|
noshua
Member
Registered: 19th Nov 08
User status: Offline
|
http://detectmobilebrowsers.com/
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
A real man would build their website using semantic HTML5, then use CSS media queries to alter the layout for mobile and tablet users
Edit: actually looking at the link I posted - I think I meant to share the one noshua put up because I'm sure I never paid for it before.
[Edited on 07-08-2012 by ed]
|
Nismo
Member
Registered: 12th Sep 02
User status: Offline
|
I dont think you pay for the one you put up, you can give a donation but theres a free download link too.
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
Assuming everyone just uses the Rewrite rules rather than doing it server-side (can't think of a valid reason why you'd do it server-side if it's a site wide redirect)?
Ed - CSS media queries isn't a 100% solution for mobile sites, especially when it comes to browser compatibility (although there are JS/JQ workarounds but then you're dependant on JS being enabled).
Edit - You'd also probably also want to change the rewriterule to include paths/passing variables eg -
code: RewriteRule ^/(.+) http://m.mydomain.com/$1 [R,L]
[Edited on 08-08-2012 by Dom]
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
Server side tests can be useful if you want the user to be able to override the re-direct. Can be annoying if the website kindly redirects you to a mobile site which has limited functionality.
Saying that, I'm sure you could do something fancy with conditional redirects/rewrites if needed to.
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
quote: Originally posted by ed
Saying that, I'm sure you could do something fancy with conditional redirects/rewrites if needed to.
Not sure about Apache but under Nginx you have cookie access in the configs, so you could give the option of overriding the default mobile site redirection if you wanted.
[Edited on 08-08-2012 by Dom]
|