I am using a home grown small CGI Router for a simple webapp, code can be found here on github
The webapp has a login form like this
my $form = start_form( -method => 'post', -action => '/login' );
$form .= p( label('Mail'), textfield( -name => 'mail' ) );
$form .= p( label('Mail'), password_field( -name => 'pass' ) );
$form .= p( submit( -value => 'Log ind', -class => 'button button-primary' ) );
$form .= end_form();
and I have a router handling the post request like this
$router->add_route( 'POST', '/login', sub {
if ( param ) {
# Get mail and pass
my $mail = $cgi->param( 'mail' );
my $pass = $cgi->param( 'password' );
# Check against user table
# Set cookie and redirect to admin
}
# Otherwise redirect to /login
print redirect( -url => '/login' );
});
on my local environment, osx 10.10.3, perl 5, version 18, subversion 2 (v5.18.2), this is working like expected, I submit the form and handle the login, no problem.
my production environment is a Microsoft-IIS/5.0 according to ENV{'SERVER_SOFTWARE'}
On the production environment is returning a 404 and unfortunately I am unable to get my hands on any log file that could reveal something useful.
.htaccess file on both production and local environment
# RewriteBase /
DirectoryIndex index.pl index.phtml index.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.pl [L,QSA]