带有锚链接的 mod_rewrite [英] mod_rewrite with anchor link

查看:21
本文介绍了带有锚链接的 mod_rewrite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道您不能将锚点 URL 重定向到另一个页面,但是可以将 URL 重定向到仅一个锚点吗?

I know you can't redirect anchor URLs to another page, but is it possible to redirect a URL to only a single anchor?

所以

http://www.example.com/video/{title}

总是被发送到

http://www.example.com/video.php?title={title}#player

唯一改变的是标题,锚点总是一样的.我需要重定向到尾声滑块上的某个幻灯片

The only thing that changes is the title, anchor is always the same. I need to redirect to a certain slide on a coda slider

推荐答案

RewriteRule ^/video/(.*) /video.php?title=$1#player [NE,L,R=301]

NE|noescape

NE|noescape

默认情况下,特殊字符,例如 &例如,和 ? 将转换为它们的等效十六进制代码.使用 [NE] 标志可以防止这种情况发生.

By default, special characters, such as & and ?, for example, will be converted to their hexcode equivalent. Using the [NE] flag prevents that from happening.

来源:http://httpd.apache.org/docs/current/en/rewrite/flags.html

这篇关于带有锚链接的 mod_rewrite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆