I have some private pages on my site. Those pages are accessible only for logged in users. Now, if user is not logged and he tries to visit one of those private pages he gets 301 redirect to an index pages. That's not good for SEO and not user-friendly. What is a good practice to sort it out? Is a good idea to show a sign in form with 401 http status together?
Asked
Active
Viewed 30 times
0
-
Related: [403 Forbidden vs 401 Unauthorized HTTP responses](http://stackoverflow.com/questions/3297048/403-forbidden-vs-401-unauthorized-http-responses) – unor Sep 17 '15 at 21:20
1 Answers
0
- HTTP 301 means that the requested resource was "Moved Permanently"
- HTTP 401 means that the user is "Unauthorized" to access this resource.
So yes, presenting a login page with status code 401 is the way to go.
That's exactly what this status code was thought for.

Eloims
- 5,106
- 4
- 25
- 41