Here's a guess what might work: Put all the .pl files in /cgi-bin/, and make a separate directory for the rest. Then edit wakaba.pl, and after the BEGIN statements at the top of wakaba.pl, put in something like:
chdir "../imgboard";That is, the relative path to the board that holds the files on the server.
Then, change this line in expand_filename():
my ($self_path)=$ENV{SCRIPT_NAME}=~m!^(.*/)[^/]+$!;to something like:
my $self_path="/imgboard/";Or whatever the path to the directory is, as seen from the web.
Finally, change all the lines like this:
make_http_forward(HTML_SELF,ALTERNATE_REDIRECT);Into this:
make_http_forward(expand_filename(HTML_SELF),ALTERNATE_REDIRECT);