Fixed the infinite loop if the short url is the same as long url.