【问题标题】:Can not redirect to new link无法重定向到新链接
【发布时间】:2019-07-12 13:35:00
【问题描述】:

我正在设置将我的链接重定向到新链接,但我尝试在 vhost 中设置很多次,设置效果不佳。请帮我。 我正在使用 apache 2.4

旧链接:/ac/bc?pagename=Test/TestClassfication&id=006&level=001

新链接:/ac/test/006.html

我的设置: RewriteRule ^/ac/bc?pagename=Test/TestClassfication&id=006&level=001$ /ac/test/006.html [R=301,L]

我也用这个设置检查了一些在线工具,但没有用。

RewriteCond %{QUERY_STRING} (^|&)pagename\=Test/TestClassfication($|&)

RewriteCond %{QUERY_STRING} (^|&)id\=006($|&)

RewriteCond %{QUERY_STRING} (^|&)level\=001($|&)

重写规则 ^ac/bc$ /ac/test/006.html? [L,R=301]

【问题讨论】:

    标签: redirect apache2.4


    【解决方案1】:

    我找到了解决办法,谢谢大家。

    RewriteCond %{REQUEST_URI} ^/ac/bc

    RewriteCond %{QUERY_STRING} ^pagename=Test/TestClassfication&id=006&level=001$

    重写规则 ^(.*) /ac/test/006.html? [R=301,L]

    【讨论】:

      猜你喜欢
      • 2019-11-06
      • 2016-02-11
      • 1970-01-01
      • 2014-05-25
      • 1970-01-01
      • 2014-06-08
      • 1970-01-01
      • 2016-08-28
      相关资源
      最近更新 更多