【问题标题】:Redirect link to new link with anchor tag使用锚标签将链接重定向到新链接
【发布时间】:2014-05-29 23:49:13
【问题描述】:

我有网址:www.example.com/test/here。

我想将其重定向到:www.example.com/test2/home#here。

我试过了:

RewriteRule  /apply$ www.example.com/test2/home#here [R, NE]

但我目前遇到服务器错误。抱歉,我不太擅长 htaccess 文件。

【问题讨论】:

  • 您希望/apply$ 匹配test/here 因为...?

标签: apache .htaccess redirect


【解决方案1】:

您因此收到服务器错误:

[R, NE]

你的重写标志中不能有空格,它会混淆 mod_rewrite 并让它认为它是一个额外的参数,从而让它认为你没有用 ] 关闭你的标志。

除此之外,你是正则表达式模式:/apply$ 永远不会匹配 /test/here。或许,您应该改用^test/here$

【讨论】:

    猜你喜欢
    • 2019-11-06
    • 1970-01-01
    • 2018-12-12
    • 2021-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-11
    相关资源
    最近更新 更多