$_GET and URL Rewriting for PHP
问题 How does URL rewriting affect the $_GET parameter for PHP? Say I have a URL like http://example.com/index.php?p=contact and I use $_GET['p'] to tell index.php to serve the contact page. If I use a rewrite rule that converts the URL to http://example.com/contact , will $_GET['p'] still work as expected? If it does, could you elaborate on why it works? If not, what strategies could be used to solve the problem so that the page will work both with and without the rewrite? 回答1: Yes, that will