无法重定向到新链接

时间:2019-02-19 05:50:00

标签: redirect apache2.4

我正在设置将链接重定向到新链接,但是我尝试在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($ |&)

RewriteRule ^ ac / bc $ /ac/test/006.html? [L,R = 301]

1 个答案:

答案 0 :(得分:0)

谢谢,我找到了解决方法。

RewriteCond%{REQUEST_URI} ^ / ac / bc

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

RewriteRule ^(。*)/ac/test/006.html? [R = 301,L]