} else { # no dest arg
$basename = $_SERVER['REDIRECT_URL'];
$basename = ereg_replace('.*/', '', $basename);
- $basename = ereg_replace('\.html$', '', $basename);
+ $basename = ereg_replace('\.html?$', '', $basename);
if($basename == '') {
$basename = 'index';
}