Fix bug in dir and Now can recorgnize url has only one dir