Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile_fu shows Mobile Site to Search Bots (googlebot) instead of Desktop Site #9

Open
rankinit opened this issue Sep 13, 2010 · 8 comments

Comments

@rankinit
Copy link

Mobile_fu shows Mobile Site to Search Bots (googlebot) instead of Desktop Site. This is causing my site not to get indexed properly by google. For example when you do a site:MYSITE.COM in google look at the first link, homepage.. and select "cached" from google's search result page you will see that it is caching my mobile version of my home page instead of the desktop version.

@capotej
Copy link

capotej commented Nov 1, 2010

I can confirm this issue as well.

@lukas2
Copy link

lukas2 commented Jan 7, 2011

me too. any ideas how to fix this?

@rankinit
Copy link
Author

rankinit commented Jan 7, 2011

in the mobile_fu.rb in the vendor/pugins/mobile_fu/lib/mobile_fu.rb look at the method

is_mobile_device?

Do a check on the request.user_agent to see if it matches any of the publicly known search bots: ["googlebot", "msnbot", "mediapartners-google", "ia_archiver", "ask jeeves", "teoma","msnbot-media", "msnbot-webmaster"]

thats roughly what I did to fix

@lukas2
Copy link

lukas2 commented Jan 7, 2011

it should be possible somehow to set the default-case to desktop-view. the same seems to happen in internet explorer 8. if the regexp for mobile devices does not match it could render desktop by default, no?

@lukas2
Copy link

lukas2 commented Jan 7, 2011

hrmh..
well now i fixed it like this:

before_filter :set_default_response_format

def set_default_response_format
   request.format = :html if params[:format].nil?
end

it works with ie8, but i guess ill have to wait and see what the contents of the google cache for our site will be.

@rankinit
Copy link
Author

rankinit commented Jan 7, 2011

check google webmaster tools there is something called check as google bot which will allow you to see what the google bot see when it visits your page otherwise you are going to have to wait a while for the google cache to update...

@Raphomet
Copy link

This seems to be a Rails 3 peculiarity, not explicitly a mobile_fu thing. If request.format is nil (for example, when type / is requested, which is what Googlebot asks for), Rails prefers templates that match .mobile.erb over .rhtml. Changing our (very old) file extensions from .rhtml to .html.erb fixed this problem for us.

SentulAsia referenced this issue in brainstormtech/mobile-fu Feb 14, 2012
@benlangfeld
Copy link

This project is abandoned. Please see the active fork at http://github.com/benlangfeld/mobile-fu. Please test with the released gem and master branch of the new home for the project, and file an issue on the other repo if you still have problems.

See #40.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants