The second possible problem is that hard-coding "index.htm" et al. isn't sufficient unless you control the web server configuration, since the list of defaults is configured on the web server side. Consider a server that likes index.php as a default.

The third problem is that your code pushes everything into @good. Oops.