- $basename = ereg_replace('.*/', '', $basename);
- $basename = ereg_replace('\.html?$', '', $basename);
+ $basename = preg_replace('|[?].*|', '', $basename); # apache 2.4.17
+ $basename = preg_replace('|.*/|', '', $basename);
+ $basename = preg_replace('|\.html?$|', '', $basename);