I want to redirect the user to m.domainname.com on his mobile browser. I want to use the existing website but redirect to the m.domainname.com. For that how can i detect the user is on mobile or desktop. And how can i redirect the mobile version of same site.
using media screen i can create the seprate displays for mobile divices
using bootstrap i can create the responsive website. but when its on mobile browser i want to redirect the mobile version like m.domainname.com
How can i do this? And my website is in django.
You can use something like this: https://github.com/gregmuellegger/django-mobile The idea is to detect mobile device in middleware (https://docs.djangoproject.com/en/dev/topics/http/middleware/).
So, if middleware detects that request going from mobile device, and user requested the normal version of the site, you can redirect him to mobile version of the site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With