Updated login to work on subdirectory