【发布时间】:2022-02-19 15:54:03
【问题描述】:
我想在链接中使用 htaccess 中的此规则处理的链接中的 href 标记传递一个附加参数
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* . [F,L]
RewriteBase /
RewriteRule ^([^/]+)/contact.html contact.php?ln=$1 [L]
我想使用的链接是这个
/en/contact.html?t=Build 5
然后到页面应该contact.php?ln=en&t=Build 5。
如果我在 contac.php 中打印,$ _GET 只返回 ln = en。
我该怎么办?
【问题讨论】:
-
旁白:
/en/contact.html?t=Build 5- 您应该对 URL 参数值进行 URL 编码。 IE。 空格应该在查询字符串中编码为%20或+。
标签: php html apache .htaccess hyperlink