I'm porting a CGI application from an embedded web server to run under Apache. In the effort of changing the least amount required I'm trying to figure out how to configure Apache so any requests coming in go to my CGI program, which then will use the QueryString environmental variable to determine which file needs to be created.
I have Apache working now to where it will process my CGI file if it's requested directly i.e. localhost/cgi-bin/cgi_test.out
but I need to figure out how to get my application to be called whenever any file is requested:
localhost/ -> call my application with QueryString set to "" or "/"
localhost/thisFile -> call my application with QueryString set to "/thisFile"
I have been doing all of my configuration testing under /etc/apache2/sites-available/mysite, which has been enabled and the default disabled.
Thanks for any help.
I've tried the recommendation from here: http://serverfault.com/questions/56082/configure-apache-to-handle-all-requests-via-single-index-php but I keep getting circular redirects.
EDIT: I have tried a few different variations of mod-rewrite but they have not worked yet.
I have an index.cgi file under /usr/lib/cgi-bin (default location) and the default index.html under /var/www/. I've reverted everything back to default settings so I'm ready to start fresh with any new ideas.