our %page = (
'' => [ STATIC_PAGE, '404', '404 Not Found', '404 Not Found' ],
- '/' => [ STATIC_PAGE, 'index', 'Chendex', 'Forum Index' ],
+ '/' => [ STATIC_PAGE, 'index', 'Chendex', 'Forum Index' ],
'/+/' => [ DYNAMIC_PAGE, 'img', '+', 'General Discussion Board' ],
'/sys/' => [ DYNAMIC_PAGE, 'img', 'System', 'Site Info' ],
);
my $cgi = CGI->new;
my $vars = {
-
+ ip => $ENV{'REMOTE_ADDR'} || '?',
+ uri => $ENV{'REQUEST_URI'} // '/',
};
- my $path = $ENV{'REQUEST_URI'} // '/';
-
print $cgi->header(
-Content_Type => 'text/html',
-charset => 'UTF-8',
);
- print %static{$path} // %static{''};
+
+ $page = %static{$vars->{uri}};
+ if (not $page) {
+
+ $page = %static{''};
+ }
+ print $page;
}
}