Rewrite main page