My website includes subscription based pages, meaning that the content in those pages are password protected. I would like to implement a site search, and have these protected pages appear in the search results, but require login in order to view them.
What I thought about, is creating, for each protected page, an unprotected version, and then in each of these uprotected pages do a redirect on page load to the protected version.
Are there better ways of doing this ?
There are some ways that you can do that more easy. Let say that you won to make it fully automatically on all page, then you go to the
global.asax, on the AuthenticationRequest and if you see that is a google crawler, or a crawler in general you automatically loggin him with a simple login name.Must have in mine that any one can set a false browser id and see your “protected page”. And the code can be:
relative:
http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.setauthcookie.aspx