关于cgi查询的RedirectMatch无法正常工作

时间:2013-03-14 00:15:01

标签: apache mod-alias

我正在尝试将网址重定向到符合特定条件的cgi脚本。即我不想将每个查询重定向到该脚本,只是那些具有特定参数的查询。但我无法让它发挥作用。这是我的重定向:

RedirectMatch /cgi-bin/Pwebrecon.cgi?BBID=(.*) http://adelaide.hosted.exlibrisgroup.com:1701/primo_library/libweb/action/dlDisplay.do?vid=SUA\&docId=SUA$1

我成功地使用了RedirectMatch很多次,但从未使用过cgi脚本。 任何人都知道如何使这项工作?

1 个答案:

答案 0 :(得分:0)

mod_alias仅处理网址的路径部分,而不是查询。

以下指令会将http://example.com/old.html?name=value重定向到http://example.com/new.html?name=value$标记路径的结尾,而不是URL的结尾。

RedirectMatch permanent ^/old\.html$ /new.html

mod_rewrite是处理(即重写)查询所必需的。