Share

OpenSRS Hosting Add-Ons

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Fix for bug in redirect.cgi

You are viewing a single message from this topic. View all messages.

  1. 2001-02-05 22:25:46 UTC
    I haven't yet had time to fix up all the bugs in that first prototype and release a new package, but if you tried the 0.01 release and couldn't figure out why it didn't work, one reason might have been the bad redirect.cgi.

    Try this instead:

    #!/usr/bin/perl

    $parkedpage = "index.shtml";

    BEGIN {
    do "/<path_to_your>/redirect.conf";
    }

    $server = lc($ENV{'HTTP_HOST'});

    $server =~ s/^www.//; # strip the http://www. so we can write
    # only the fqdn to the conf file,
    # will make it smaller...

    @domains = keys(%redirects);
    foreach $domain(@domains) {
    if ($domain eq $server) {
    print "Location: $redirects{$domain}\n\n";
    $match="yes";
    last;
    exit
    }
    }
    unless ($match) {
    print "Location: http://$server/$parkedpage\n\n";
    exit
    }
    exit;
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.