FormBasedAuthentication with Apache 2.4 <p>I wanted to protect/secure the directory with form based authentication of Apache but I've special scenario.</p> <p>Below is the 3 directory I've and I need to secure and lock down specific secure page for specific user only as follow:</p> <pre><code>eg : https://www.abcd.com/secure/page1 only testuser1 https://www.abcd.com/secure/page2 only testuser2 https://www.abcd.com/secure/page3 only testuser3 </code></pre> <p>I can achieve this but I need to create it's own Login.html page and password file as follows. Is there any way to have one login.html page for all secured page and lock down the users's access to their own secured page. </p> <p>(1) login1.html and login2.html</p> <p>login1.html</p> <pre><code>&lt;form method="POST" action="/secure/page1"&gt; Username: &lt;input type="text" name="httpd_username" value="" /&gt; Password: &lt;input type="password" name="httpd_password" value="" /&gt; &lt;input type="submit" name="login" value="Login" /&gt; &lt;/form&gt; </code></pre> <p>login2.html</p> <pre><code>&lt;form method="POST" action="/secure/page2"&gt; Username: &lt;input type="text" name="httpd_username" value="" /&gt; Password: &lt;input type="password" name="httpd_password" value="" /&gt; &lt;input type="submit" name="login" value="Login" /&gt; &lt;/form&gt; </code></pre> <p>(2) create password.file1 for testuser1 and password.file2 for estuser2</p> <p>(3) Need to defined seperate location for each page in httpd.conf : </p> <pre><code>&lt;Location /secure/page1&gt; Require valid-user AuthFormProvider file ErrorDocument 401 /login/login1.html AuthUserFile /test/password.file1 AuthType form AuthName realm AuthFormLoginRequiredLocation https://www.abcd.com/login/login1.html Session On SessionCookieName session1 path=/ SessionCryptoPassphrase secretpass &lt;/Location&gt; &lt;Location /secure/page2&gt; Require valid-user AuthFormProvider file ErrorDocument 401 /login/login2.html AuthUserFile /test/password.file2 AuthType form AuthName realm AuthFormLoginRequiredLocation https://www.abcd.com/login/login2.html Session On SessionCookieName session2 path=/ SessionCryptoPassphrase secretpass &lt;/Location&gt; </code></pre> <p>So,how to secure or restrict access to directory with particular user only using single Login.html page</p> <p>Ref : <a href="https://httpd.apache.org/docs/2.4/mod/mod_auth_form.html" rel="nofollow">https://httpd.apache.org/docs/2.4/mod/mod_auth_form.html</a></p>