Fix bug in html redirect

Should be redirecting based on query_path not document_path