Simple. Just determine if it has an extension. If it does, take it out, add .html. It may have 2 extensions, which you should remove the LAST one, or add on to it.