且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用(mod 重写支持)漂亮的 URL 读取 $_GET 变量

更新时间:2023-11-26 23:36:34

您需要添加QSA(查询字符串追加)到您的标志.

You need to add QSA (query string append) to your flags.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,PT,L]

然后您的 $_GET 将包含正确的值.

Then your $_GET will contain the correct values.