What kind of HTTP redirect for logins?

2019-09-07 02:14发布

问题:

I'm currently redirecting users to a login page when they try to hit their home page.

For example: http://www.goals.com/login.php?from=%2Fhome.php

Unfortunately, I'm also told that 302 redirection hurts SEO, and this type of redirection is showing up as a 302. Is this the correct HTTP status code for this type of redirection, or is there a better practice I should be following?

回答1:

SEO doesn't matter if the homepage is password protected. Crawlers can't login to see the content, so your concern is moot.