我需要这样做:当有人输入https://mydom1.re.it/sso_mio/<whatever>
时,我需要重定向到https://mydom2.re.it/sso_mio/<whatever>
。所以,在ssl.conf文件中,在mydom1中。 re.it部分,我有以下内容:
<VirtualHost 192.xxx.yyy.zzz:443>
ServerName mydom1.re.it
SSLEngine on
SSLProxyEngine on
RewriteEngine on
SSLCertificateKeyFile ...
SSLCertificateFile ...
SSLCertificateChainFile ...
SSLSessionCacheTimeout 600
RewriteRule ^(sso_mio.*) https://mydom2.re.it [R=301,L]
ProxyPass / http://mydom1.re.it/
ProxyPassReverse / http://mydom1.re.it/
ErrorLog "|/usr/sbin/rotatelogs /var/log/httpd/mydom1/mydom1_ssl_error_log 86400"
CustomLog "|/usr/sbin/rotatelogs /var/log/httpd/mydom1/mydom1_ssl_access_log 86400" combined
</VirtualHost>
但它不起作用,它不进行重定向。你能告诉我原因吗?
此测试人员http://htaccess.madewithlove.be/表示重定向很好。
答案 0 :(得分:0)
尝试这样的重写。
RewriteRule ^sso_mio/([^/]+) https://mydom2.re.it/sso_mio/$1 [R=301,L]