Redirect mobile. Is it unnecessary?

Started by Ronny, Aug 19, 2022, 02:54 AM

Previous topic - Next topic

RonnyTopic starter

Gentlemen, can you give me a hint? Here is a redirect to the mobile version of the site. I found a list of user agents on the web:

midp|samsung|docomo|wireless|nokia|novarra|palmsource|phone|NEC|cdm|palmos|upb|opwv|iphone|mot|blackberry|mib|symbian|chtlhand|mobi|pda|dddi|mmp|audio|nokia|SEC|HTC|j2me|avant|samsung|gradi|pg|mitsu|SIE|alcatel|eric|sch|rover|bird|sagem|sony|pocket|wap|lg|benq|vx|xx|philips|sgh|jb|mmm|panasonic|amoi|sharp|pt|vox|compal|java|kg|voda|sany|dbt|sendo|moto|kdd|androidInterested in how this works. I see 2 letter user agents in this list such as xx, vx, pt, pg, kg

Nothing unnecessary will redirect to the mobile version? Do I understand correctly, when any word in the user agent is found with 2 such letters in a row, it will redirect?

I have visited the site from different desktop browsers, everything seems to be fine, it doesn't redirect.

P.S. I know that in 2022 we should do adaptive, the question is about something else.


In the case you described, I recommend using ready-made library
The library is a PHP class, fairly easy to detect and do the right thing for smartphones, tablets, and similar surfing method devices. Tested, everything works fine.


I also use this library in mine.
How to connect the library, quite detailed on overcoder and haizdesign.
No complaints, remarks and stuff like that, I recommend it. :)