derekstucki has asked for the wisdom of the Perl Monks concerning the following question:
This isn't so much a question on how to use perl, but how to best implement something written in perl. I've been working on a website that serves every page via perl CGI, but I'd now like to hide the "/cgi-bin/" in the page addresses. I currently have www.mysite.com/ using SSI in www.mysite.com/index.shtml to serve www.mysite.com/cgi-bin/home.cgi, and so I was thinking of doing the same thing with all other pages, for example, www.mysite.com/products/index.shtml serving /cgi-bin/products.cgi, etc, thus making a directory for each .cgi in /cgi-bin/ with an index.shtml in each directory. Obviously, this directory making nonsense would be automated by a perl script. :)
However, I've been recommended by a friend of a friend ( who may be a PHP or visual basic programmer for all I know ) that the better way to accomplish this is by using a .htaccess file directive using mod_rewrite. In order to do this, I think I'd have to do the same thing with directories with a .htaccess file in each directory for each .cgi, or have a line or two per .cgi file in the root .htaccess.
My question is this: which of these two methods is better, and why? Or do you know of a third method that works better than either of these?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: mod_rewrite VS SSI VS your better idea
by rnewsham (Curate) on Aug 20, 2013 at 05:14 UTC | |
Re: mod_rewrite VS SSI VS your better idea (meaningful urls)
by Anonymous Monk on Aug 20, 2013 at 07:20 UTC | |
Re: mod_rewrite VS SSI VS your better idea
by derekstucki (Sexton) on Aug 21, 2013 at 17:40 UTC |