Why does my CGI script keep redirecting links to localhost?

Posted by Noah Brainey on Stack Overflow See other posts from Stack Overflow or by Noah Brainey
Published on 2010-12-26T01:44:07Z Indexed on 2010/12/26 2:54 UTC
Read the original article Hit count: 246

Filed under:
|

Visit this page http://online-file-sharing.net/tos.html and click one of the bottom footer links. It redirects you to your localhost in the address bar. I have no idea why it does this.

This is in the main script that my entire website revolves around:

upload.cgi

$ENV{PATH} = '/bin:/usr/bin'; 
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
($ENV{DOCUMENT_ROOT}) = ($ENV{DOCUMENT_ROOT} =~ /(.*)/);
# untaint. #$ENV{SCRIPT_NAME} = '/cgi-bin/upload.cgi';
use lib './perlmodules';
#use Time::HiRes 'gettimeofday';
#my $hires_start = gettimeofday();
my (%PREF,%TEXT) = (); 

No file is displayed when someone visits the root directory, although I have a .htaccess file saying to open my upload.cgi file which is located in my root directory.

When I point my browser directly to the CGI file it works but it brings me to my localhost again.

I'm hosting this website on my own server, which is this computer, and using XAMPP if this information helps. I'm also using DynDNS as my nameservers.

I hope you can give me some insight.

© Stack Overflow or respective owner

Related posts about localhost

Related posts about xampp