Ruby on Rails Allow Tracking / Indexing of protected pages -


i need allow indexing of user protected pages facebook sharing. basically, have ror app offers coupons , need users able share coupon on facebook. problem user must have account view coupon details on each coupon's page. want them able share coupon (title, price only) link coupon, link coupon redirect sign page if user not have account. therefore, when facebook (and other indexing robots) go pull info coupon url, redirected sign page , index sign page info instead of coupon page info.

any way allow indexing of each coupon page crawlers, redirect actual users sign page?

found post... ended using second answer given. in coupons controller's show method, updated before_filter like:

if ( !request.env["http_user_agent"].match(/\(.*https?:\/\/.*\)/) && !user_signed_in? )      redirect_to new_user_registration_path end 

therefore when request made view coupon, allow robot through index page, redirect non-signed-in users either register or login. useful in case facebook sharing, i'm sure seo , other indexing. used facebook developer tools verify indexing properly.

hope helpful else out there.


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -