Fix the redirect issue when close site.