I have a website built on WordPress and I'm also working on react app for mobile devices. I want that if the user requested from mobile devices then Server serve the react app not WordPress website, WordPress website only loaded when the request is from the desktop. is it possible?
Asked
Active
Viewed 159 times
0
-
1you can detect user agent and redirect; more: https://stackoverflow.com/questions/11381673/detecting-a-mobile-browser – r g Apr 09 '19 at 12:29
-
Is "window.orientation" works on server?, actually i need to server full react app on mobile request,so its kind of like i need to configure server for this! – Ashish Sharma Apr 09 '19 at 12:39
-
You can redirect with javascript before page fully loads. If you want to do it fully server side then you can use it like that: https://stackoverflow.com/questions/11387800/nginx-redirect-mobile-requests-to-mobile-uri . If you want detailed answer, then we need more info about your web server – r g Apr 09 '19 at 12:43
-
And since its Wordpress i assume you can benefit with http://detectmobilebrowsers.com/ php script – r g Apr 09 '19 at 12:45
-
just suppose like this i have abc.com ,and i want that if i visit abc.com on desktop i want wordpress website but in the case of mobile devices i want react app instead of wordpress site. – Ashish Sharma Apr 09 '19 at 13:12
-
and thank you for your answer but your answer will add mobile/ extra on the url – Ashish Sharma Apr 09 '19 at 13:13