Forum Moderators: phranque

Message Too Old, No Replies

file location problem

         

smallcompany

1:48 am on May 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have a Perl script that parses all HTML files within my site. If I keep the script in the root of my site, in .htaccess I would have these three lines to make it work:

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.html$ parser.cgi?file=$1 [QSA,L]

Now I have one of the sites being run on a VPS plan where the hosting company keeps CGI scripts in a separate folder. I had no problem with adjusting the path to the script itself in order to call it for parsing:

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.html$ /var/www/cgi-bin/parser.cgi?file=$1 [QSA,L]

.htaccess file is in the root of the site which is in /var/www/html/

Now it happens that parsing Perl script cannot find any of the requested files except the home page, so 404 happens every time.

My thinking tells me that parser.cgi?file=$1 points to files inside "cgi-bin" folder, but obviously they are not there. Would that be where the change is needed?

Thanks

P.S.
Aside of this concrete problem, I see that folders of this Apache package get kind of mirrored. For example, real server path like /var/www/cgi-bin/ would automatically replicate to /var/www/html/cgi-bin/
This gives me the impression I could use either path to call the script from within “cgi-bin” folder. Am I correct? Thanks

smallcompany

4:55 am on May 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



My thinking
...may not be good...

I better dive into the script itself and ask my question in Perl section.