Remove the trailing .htm/.html before guessing filetype