简体   繁体   中英

Identify if a website is mobile friendly or not

What are the options to detect if a site has mobile friendly or not using php. Currently I am checking if the site has view-port meta tag, CSS3 @media attribute, mobile redirection by sending mobile user-agent via curl. In most cases it works fine, but in few cases it does not work.

Do people use some other logic to make their website mobile friendly? If so, what are those logics?

If you wan to redirect for mobile, you can use mod_rewrite in your .htaccess file. I do this:

### MOBILE AGENT REDIRECT
RewriteCond %{HTTP_USER_AGENT} "(android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos)" [NC]
RewriteRule ^.*$ http://m.mysite.com/ [L,R=302]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM