fixing to loging redirection from permalinks