rewrite index