$_GET and URL Rewriting for PHP

后端 未结 7 2147
旧时难觅i
旧时难觅i 2020-12-13 22:09

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 $_G

7条回答
  •  渐次进展
    2020-12-13 22:27

    When the client requests http://example.com/contact, the server uses the rewrite rule to serve them http://example.com/index.php?p=contact instead. The client will not be able to see the rewritten URL and might not even be able to tell that it was rewritten. Requesting either URL as the client would give you the exact same page.

提交回复
热议问题