Sometimes, we get a requirement to have password-protected pages on public-facing websites. Sitecore provides an out-of-the-box extranet login functionality, which is very simple and easy to achieve compared to ASP.NET.
In this recipe, we will implement extranet login for public-facing websites.
In our site, we have a Members section, which should be accessible only by authenticated or logged in users. All other pages should be accessible to everyone. So, the site structure looks like the following image:
If you have implemented the 404 Page Not Found handler, it will show the 404 page on the request of these restricted pages as anonymous users do not have read rights on them. So, to make this recipe work, you either disable this handler or modify it to not show a 404 page for these pages.