A client I am working for does this.
www.website.com/thewebpage (for non members)
learn.thewebsite/thewebpage (for logged in members. Same content, but with a different layout, and some extra goodies. If a member is logged in and access www.website.com/thewebpage they are redirected to learn.thewebsite/thewebpage. If a user is not logged in, and visits learn.thewebsite/thewebpage, the are redirected to a login page )
The problem? A bunch of members have written great content, linking to the logged in version learn.thewebsite/thewebpage
Google arrives, and as they are not logged in, they get redirected to the login page, which they of course cant do.
Rather than email all these websites (literally thousands) and ask them to change the link to the www version, I want to detect if user agent is Google, and redirect from the learn version to the www. Its literally, what the website adding the link wanted to do in the first place.
OK, it's cloaking... but is this kind of cloaking likely to bring a penalty?
I am considering modifying the setup as follows
1. learn.thewebsite/thewebpage so it's like the newyorktimes. Paywall, google can crawl it, people, can't access it without logging in
2. Initially, the content shown to google, and to users (prior to logging in, but obscured by a login popup) is the same content as on learn.thewebsite/thewebpage
3. d I set the canonical back to www.thewebsite/thewebpage to drive the link juice to the correct page.
4. On login, the slightly revised content is shown.