Correct templates loading and gestion of application in subdirectory