RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.html$ parser.cgi?file=$1 [QSA,L]
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.html$ /var/www/cgi-bin/parser.cgi?file=$1 [QSA,L]
Now it happens that parsing Perl script cannot find any of the requested files except the home page, so 404 happens on any but home page access (no index.html, but domain name only).
Here is the part of the script that takes care of file “slurp”.
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use CGI qw/:cgi/;
use Data::Dumper;
use HTML::LinkExtor;
use URI;
my $q = new CGI;
my %vars = $q->Vars();
my $file = $vars{'file'};
delete $vars{'file'};
my $content = slurp("$file.html");
print $q->header(), $content;
I wonder if I need to declare the path to that “file” variable? If true, how? The reason I think this way is the fact that the script works just fine if it’s in the site’s root directory on any shared hosting plan.
Thanks
The script is all about parsing the whole HTML and inserting variables to the end of URLs so they get carried over while you browse through the site.
Thanks very much for clarification.