I’m creating a small application on an embedded device that has a boa web server running on it. I’m creating a web application in a mixture of plain HTML pages and Perl scripts to interface with the main application. Is there a way to hide the fact that some of the pages are being served out of the cgi-bin on the device?
What I have now are the following URLs.
- http://localhost/home.html
- http://localhost/cgi-bin/config.pl
- http://localhost/cgi-bin/control.pl
- http://localhost/info.html
What I would greatly prefer would be:
with the above URLs taking me to the appropriate index.html or index.pl document. Is there some combination of file structure and server settings that will enable this behavior?
I’ve searched Google for this, but as you can imagine I’m getting pages and pages of search results with ‘cgi-bin’ in the URL. I’m hoping someone here has done this before.
EDIT: I should mention that I know how to do this for plain HTML pages by making separate folders in my web root, all with index.html pages. My problem is in getting this type of solution to work with .pl or .cgi files in the cgi-bin directory.
Boa unfortunately doesn’t appear to have any type of mod_rewrite options available to it, so you’re limited in what you can do to rewrite a URL. From the boa docs here are the options you do have available:
Redirect, Alias, and ScriptAlias
Based on that you might try ScriptAlias or Alias, or even a symlink to a ‘nicer’ URL. Unfortunately since I don’t have Boa available here I can’t test the options to tell you more specifically what to try.