【发布时间】:2014-04-19 10:07:04
【问题描述】:
我打算捕获指向 CGI-BIN 的 url 请求,并使用参数和 https 将它们转发到不同的域。
例子:
http://example.com/cgi-bin/scrip1.py?name=Hello
到
https://another.com/cgi-bin/script2.py?name=Hello
由于请求在链接中有 CGI-BIN,mod_rewrite 不起作用:/
RewriteRule ^/cgi-bin/script1.py(.*)$ https://%{HTTP_HOST}/cgi-bin/script2.py$1 [NC,R=301,L]
它适用于非 CGI 请求,但适用于 CGI 请求。我错过了什么吗?
注意:理想情况下,我想捕获 script1.py 之后的参数,并将它们传递给 script2.py
【问题讨论】:
-
RewriteRule ^cgi-bin/script1\.py$ https://another.com/cgi-bin/script2.py [NC,R=301,L,QSA]
标签: apache .htaccess mod-rewrite redirect cgi-bin