2013-03-14 50 views
0

我在嘗試將URL重定向到符合特定條件的cgi腳本。即我不想將每個查詢重定向到該腳本,只是那些具有特定參數的腳本。但我無法讓它工作。這裏是我的重定向:cgi查詢無法正常工作的RedirectMatch

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腳本。 任何人都知道如何使這項工作?

回答

0

mod_alias只處理URL的路徑部分,而不處理查詢。

以下指令將重定向http://example.com/old.html?name=valuehttp://example.com/new.html?name=value$標誌着路徑的結束,而不是URL的結束。

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

mod_rewrite是必要的處理(即,重寫)查詢。