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.
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
Redirect, Alias, and ScriptAlias all have the same semantics -- they match the beginning of a request and take appropriate action. Use Redirect for other servers, Alias for the same server, and ScriptAlias to enable directories for script execution.
Redirect
allows you to tell clients about documents which used to exist in your server's namespace, but do not anymore. This allows you tell the clients where to look for the relocated document.
Alias
aliases one path to another. Of course, symbolic links in the file system work fine too.
ScriptAlias
maps a virtual path to a directory for serving scripts.
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.