.htaccess password and forced login

Posted by Boco on Stack Overflow See other posts from Stack Overflow or by Boco
Published on 2011-01-08T11:49:26Z Indexed on 2011/01/08 11:53 UTC
Read the original article Hit count: 151

Filed under:

I have password protected website with .htaccess. What I want to do now is to force users to login from the index.html page and not from any other which they can do now. ie. I have index.html (the main page) and I have two other pages 1.html and 2. html also protected with .htaccess password. Users can now type http://www.mypage.com/1.html and they will be asked for login data but I would like to force them (before they are asked for login details) to index.html to login. After they are loggedin they can use any link (ie.1.html or 2.html) as they want.

Can this be done by using .htaccess? I would need the whole code. Thank you!

© Stack Overflow or respective owner

Related posts about .htaccess