rewrite main.php