Is it possible to execute a Perl script using .htaccess? What I am trying to do is use .htaccess to execute a Perl script that will prompt a user for their username/password. This is a part of the script:
&authenticate("Basic", "Restricted Area");
...
sub authenticate {
local($authtype, $realm) = @_;
print "Status: 401 Authentication Required\n";
print "WWW-Authenticate: ".$authtype." realm=\"".$realm."\"\n" ;
$go = "http://www.mysite.com/members/index.html";
print "Location: $go\n\n";
exit(0) ;
}
Code:
&authenticate("Basic", "Restricted Area");
...
sub authenticate {
local($authtype, $realm) = @_;
print "Status: 401 Authentication Required\n";
print "WWW-Authenticate: ".$authtype." realm=\"".$realm."\"\n" ;
$go = "http://www.mysite.com/members/index.html";
print "Location: $go\n\n";
exit(0) ;
}