You want to use option 1. The reason for this is that if you display the form on every URL that requires a login, you will have two problems:
- Search engines will assume that the login form is the actual content of this URL instead of the actual content. Obviously, this is not what you want.
- Google will see that all of these pages duplicate content, which is bad. Their Panda algorithm is specifically designed for a large number of duplicate content, and this can lead to the fact that your site as a whole will be punished for low quality content.
Using 302 redirects would be the right way to do this, as you have already discovered. And using the right status codes matters. Search engines interpret their meaning and sending the wrong status code can lead to negative consequences. Since sending the correct HTTP status code is easy to do, it is definitely worth doing.
John conde
source share