I am trying to get Apache to run a cgi executable in my "project" directories. It should respond to HTTP requests at:
However, it should not respond to http requests at
localhost/packages/PackageName localhost/packages/PackageName/ localhost/packages/PackageName/more/stuff
To that end, I have created an Apache configuration file which contains:
ScriptAlias /doc_cgi/ /long/path/to/cgi/DocCGI.haskell/ RewriteEngine On RewriteRule ^/packages/?$ /doc_cgi/packages/ [L,PT] <Directory "/long/path/to/cgi/"> Order deny,allow Allow from all AddHandler cgi-script .haskell Options +ExecCGI </Directory>
The cgi program is invoked when I make http requests to localhost/doc_cgi/, as expected. But it appears the rewrite rule is not being triggered when I make requests to
for I get 404 errors, and the log says:
[Wed Jul 20 12:29:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/packages
For completeness, here are the relevant parts of the configuration file which defines how I handle requests to localhost/packages/PackageName/etc:
AliasMatch ^/packages/(.+)/(.*) /development/code/haskell/packages/$1/dist/doc/html/$1/$2 <Directory /development/code/haskell/packages/*/dist/doc/html/*/ > Options Indexes Order deny,allow Allow from all </Directory>
This does work as expected.
Can anybody help me figure out why my rewrite rule isn't being triggered? Or some hints on how to figure that out myself?