重写的 URL 应包含#。我该如何解决这个问题?
其实我想通过.htaccess
重写URL。
我的实际 URL 是
front/property/uploadphotos_pid.php?pid=11#NO
我想将其转换为
uploadphotos_pid/11/NO.php
并编写了以下代码:
RewriteRule ^uploadphotos_pid/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+).php$
front/property/uploadphotos_pid.php?pid=$1&#=$2
Actually I want to rewrite URL through .htaccess
.
My actual URL is
front/property/uploadphotos_pid.php?pid=11#NO
I want to convert this to
uploadphotos_pid/11/NO.php
and have written following code:
RewriteRule ^uploadphotos_pid/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+).php$
front/property/uploadphotos_pid.php?pid=$1=$2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
片段标识符(以
#
开头的 URI 部分)完全由客户端处理。它不会发送到服务器。因此,服务器(mod_rewrite 运行的地方)无法对其执行任何操作。The fragment identifier (the section of a URI starting with
#
) is handled entirely client side. It is not sent to the server. The server (which is where mod_rewrite runs) therefore cannot do anything with it.# 必须在 URL 中转义为 %23
# must be escaped as %23 in a URL