building index for redirection