简体   繁体   中英

Transfer instead of redirect to login in forms authentication

I give to google a sitemap with all my pages, when the crawler tries to access them he gets redirected to the login page.

In the login page I write an explanation of what the page does so the crawler can see that each page is different.

The problem now is that the bot is clever enough as to recognize that it is a redirect:

URLs not followed When we tested a sample of URLs from your Sitemap, we found that some URLs redirect to other locations. We recommend that your Sitemap contain URLs that point to the final destination (the redirect target) instead of redirecting to another URL. HTTP Error: 302

If instead of using a redirect in RedirectToLoginPage(String), Microsoft had used a Server.Transfer, google would never find out it is actually the same page.

Any Ideas?

As Carl said, if access to your content requires a log in, then there isn't a whole lot you can do.

However, if you can separate out a "teaser" of each content page and have a link to "read more" from those pages that requires a login, then you'll be good to go.

The teaser page should have enough searchable text that google will be able to successfully include it in search results.

There are a number of sites that do just this. You search for something, click on the link to go to their site. Once there you can see maybe two paragraphs worth of information. If you want more a link takes you to a login / register page.

Okey I found a not elegant solution, but it suits my needs:

http://forums.asp.net/t/1358997.aspx

""For now, I found a workaround: I capture the End-request event and see if the status code is "302 redirected"; if it is, I'll just alter the address from there and do whatever I need to do. Not the most elegant solution (and requires more processing for every page request; not just login redirects), but at least it works.""

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM