Forum Moderators: phranque

Message Too Old, No Replies

Mobile Redirection - Possible SEO Problems?

Will the following code incur any problems?

         

WannaKnowSEO

8:06 am on Dec 31, 2008 (gmt 0)

10+ Year Member



Does anyone see an SEO / Google Crawling problem with redirecting all mobile visitors to a single page? I intend to accomplish this with the following htaccess file:

# THESE TWO LINES ARE NEEDED FOR THE FOLLOWING REDIRECT COUPLES
Options +FollowSymlinks
RewriteEngine on

RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml¦application/vnd.wap.xhtml+xml" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "acs¦alav¦alca¦amoi¦audi¦aste¦avan¦benq¦bird¦blac¦blaz¦brew¦cell¦cldc¦cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang¦doco¦erics¦hipt¦inno¦ipaq¦java¦jigs¦kddi¦keji¦leno¦lg-c¦lg-d¦lg-g¦lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "maui¦maxo¦midp¦mits¦mmef¦mobi¦mot-¦moto¦mwbp¦nec-¦newt¦noki¦opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm¦pana¦pant¦pdxg¦phil¦play¦pluc¦port¦prox¦qtek¦qwap¦sage¦sams¦sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-¦sec-¦send¦seri¦sgh-¦shar¦sie-¦siem¦smal¦smar¦sony¦sph-¦symb¦t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli¦tim-¦tosh¦tsm-¦upg1¦upsi¦vk-v¦voda¦w3cs¦wap-¦wapa¦wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp¦wapr¦webc¦winw¦winw¦xda¦xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser¦up.link¦windowssce¦iemobile¦mini¦mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian¦midp¦wap¦phone¦pocket¦mobile¦pda¦psp" [NC]
RewriteCond %{REQUEST_URI} !^/phone/$
RewriteRule (.*) /phone/index.html [L]

Obviously, the Googlebot Crawler, Firefox, IE, Chrome, etc. user agents will all see the same regular content on the site. Only user agents with character strings known to be associated with mobile phones will be redirected. Any thoughts?

Lexur

8:37 am on Dec 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



a) the best thing you can do is test it for yourself
b) there is a counterpart into the /phone/ directory? The explorer, firefox, opera, etc. user agents will be redirected to the main index?

jdMorgan

3:35 pm on Dec 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I note that the "Webcrawler" spider and all Macintosh users will be redirected to your mobile site...

You've also got the redundant "wap-', 'wapa", and "wapi" subpatterns, all of which would also be matched by the later "wap" subpattern.

Based on the fact that there are already several problems with this list, I'll offer some general advice: These pattern-matching strings needs to be much more specific -- longer and more-detailed, and start- and end-anchored if possible. For example, match "[^a-z]Brew/[0-9]+(\.[0-9]+)+[;\)]" and not just "Brew" -- Otherwise, you may redirect users to the mobile site unexpectedly.

When I last did this, I did two things that may be helpful to you:

1) I made a list separated-out by "unmistakable mobile-device characteristics."

First I checked for strings like "Profile/MIDP-[1-9]\.[0-9]\ Configuration/CLDC-[1-9]\.[0-9]" that explicitly declare a mobile-profile device.

Then I checked for mobile-only browsers (e.g. "Brew"), then mobile-only operating systems (e.g "Windows CE").

Finally, I checked for the many, many mobile devices with 'broken' user-agent strings -- those which cannot be parsed out using a routine that recognizes the pieces of a well-formed user-agent string. There are many vendors selling phones with user-agent strings composed by someone who thought the he/she could "just put anything in there." These UA strings were not written in compliance with the 'rules' of UA string composition. In fact, you will find that some phones from a given manufacturer will have really well-thought-out UA strings, while a different model from the very same manufacturer will have a cobbled-together messy UA string that can't be handled by a general UA-string-parsing routine.

2) I also checked the HTTP_ACCEPT header for many of the above-matched UA strings to be sure that the device stated explicitly that it could handle XML+XHTML -- I considered this to be "insurance" against an unexpected match on some future non-mobile user-agent, and used it when I thought that my UA-string matching pattern was too short or "too weak."

I would guess that my code is five to ten times longer than what you've got posted here, and it still has holes in it. However, the site where I use it is small and has a 'closed membership' -- It's mostly used by people who are members of a non-profit association, all of whom know that they can report site problems and get them fixed easily... In other words, I don't need to worry about offending anyone or 'losing customers'.

Be aware that there are database packages available which you can use to look up these user-agent strings and return detailed information about the device: Whether it is a mobile device, its screen size, scripting capabilities, and much more. If you have a serious commercial application, then consider using this method, as the list of devices is kept up-to-date and you won't have to worry about it.

Jim

WannaKnowSEO

4:48 pm on Dec 31, 2008 (gmt 0)

10+ Year Member



Thanks jD. The Macintosh and Webcrawler problems were great catches. I've fixed the code accordingly.

Would you, by any chance, be willing to share your list / htaccess for mobile browsers? If so, I'd be willing to send back any improvements that may come of it.

Thanks again.

- Brett