]> git.ipfire.org Git - ipfire.org.git/blame - index.pl
The ip location banner is only visible on main page.
[ipfire.org.git] / index.pl
CommitLineData
01885878 1#!/usr/bin/perl
2
8afb2498 3my $lang = "en";
795d46bd 4my @error;
8afb2498 5
6# Set language to german, else use english site
7if ($ENV{'HTTP_ACCEPT_LANGUAGE'} =~ /^de(.*)/) {
8 $lang = "de";
9}
10
795d46bd 11if($ENV{'REQUEST_METHOD'} eq 'GET') {
12 @error = split(/=/, "$ENV{'QUERY_STRING'}");
13}
14
01885878 15print "Status: 302 Moved\n";
3ff59c7c 16print "Pragma: no-cache\n";
17
795d46bd 18if ($error[1]) {
19 print "Location: /$lang/$error[1].shtml\n";
3ff59c7c 20} else {
795d46bd 21 if ($ENV{'SERVER_NAME'} eq "source.ipfire.org") {
22 print "Location: /$lang/source.shtml\n";
23 } else {
24 print "Location: /$lang/index.shtml\n";
25 }
3ff59c7c 26}
27
28# End http header...
29print "\n";