updated to handle being served off cloudfront

which doesn't automatically redirect directories