Apache重定向URL路径和查询字符串

时间:2019-02-21 23:03:27

标签: apache

我正在尝试弄清楚如何从中重定向URL的路径

https://myweb.new.example.com/issues/?filter=111

https://myweb.new.example.com/login.jsp?os_destination=%2Fissues%2F%3Ffilter%3D111

,但是下面的代码似乎没有任何作用。我已经运行了apachectl configtest,语法正确,并且已经重新启动了apache2服务。有人可以帮我吗?我不确定自己在做什么错。谢谢。

<VirtualHost *:80>
        ServerName myweb.new.example.com
        ServerAlias myweb.new.example.com
        Redirect / https://myweb.new.example.com
</VirtualHost>

<VirtualHost *:443>
        ServerName myweb.new.example.com
        RewriteEngine On
        RewriteCond %{QUERY_STRING} ^/issues/?filter=([0-9]*)$
        RewriteRule ^login.jsp?os_destination=%2Fissues/?filter=([0-9]*)$ https://myweb.new.example.com/%1 [R=302,L]
</VirtualHost>

0 个答案:

没有答案
相关问题