2

I have one link that is login-required http://example.com/secret If user access the page without authentication it will be redirected to http://example.com/login page.

My question is can Google bot index the /secret link? (I don't want it to be displayed on the Search results).

I'm confused because as this link it said:

It will show the source page in search results if it's temporary redirect (HTTP code 302)

and this link it said:

If you want to block your page from search results, use another method such as password protection

while /secret is also both password protection page and redirect source page. I'm not sure it will be indexed or not.

1 Answer 1

0

This is not an appropriate use of the redirect mechanism. The proper way to handle this is to serve a 401 (Not Authorized) header and include your login form in the response.

while /secret is also both password protection page and redirect source page. I'm not sure it will be indexed or not.

If /secret is password protected at the server level and is only reachable by logged in users then it doesn't get indexed and Googlebot never gets redirected.

If /secret' is not password protected at the server level, Googlebot will have the same experience as an un-authenticated user, so it will be redirected to /login via whichever temporary redirect you choose. This doesn't solve your index problem. Google's indexing pipeline is going to consider any temporary redirect as a weak signal that the target should be canonical.

2
  • Thank you for the answer. Can I understand the page is password-protected at the server level is only when it returns 401, otherwise if it redirects to Login page it's not password protected at server level? Currently the /secret is redirected to /login with 302 code. And I see it's normal behavior as gmail ( https://mail.google.com/mail/u) or facebook (https://www.facebook.com/friends)
    – Quoc Lap
    Jun 8, 2022 at 5:31
  • I'm not sure I understand your question here. Jun 8, 2022 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.