Thursday, 22 August 2013

Apache: fall through to controller if matching file not found

Apache: fall through to controller if matching file not found

We have a Perl based web site that runs under Apache with mod_perl. At its
core are a large number of individual Perl scripts - one per page. For
example:
www.example.com/index.pl
www.example.com/account.pl
www.example.com/login.pl
We are slowly refactoring it and moving towards a controlled based model
where we have a single point of entry - a dispatcher. The current approach
is to replace the code in each page script with a call to the controller
as it is refactored. This leaves us with lots of stub scripts that all do
the same thing. Is there a way to tell Apache to look for a matching file
first, and if that fails, call the controller code and pass it the request
URI?

No comments:

Post a Comment