I have a simple re-write of rewrite ^/(.*) /post.php?id=$1 last; This will breaks my main index page, as domain.com will also be redirected to "post.php?id=" How can I modify my regular expression not to change the main index page? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221278,221278#msg-221278