The alternative approach involves bypassing Apache's HTTP authentication altogether, relying instead on custom programming to perform access control and session management. This allows you to customize both the user interface presented for login, and also the data source used for credential verification. You can write code for this in any language; I'll be using PHP, since it comes with built-in session management support, which will make things easier. Let's assume the following directory structure: Let's also assume that the file I need to protect is "inner.sanctum.php" First up, I need to define my custom login form. Here's what I came up with: Here's what it looks like: ![]() Once the user submits this form, the username and password entered will be stored in the form variables $f_user and $f_pass respectively. These variables can be accessed by the PHP-based form processor, coming up on the next page.
blog comments powered by Disqus |