我正在尝试将我的Apache服务器配置为同时重定向两者:
通过非SSL http://support.nile.sd
和SSL https://support.nile.sd
到链接https://support.nile.sd/otrs/customer.pl
,HTTP请求可以通过以下force-redirect.conf
重定向:
$ vim /etc/httpd/conf.d/force-redirect.conf
<VirtualHost *:80>
ServerName support.nile.sd
Redirect permanent / https://support.nile.sd/otrs/customer.pl
</VirtualHost>
但是HTTPS不会重定向!!它会转到一个奇怪的页面,如下所示:
/的索引
名称上次修改的尺寸说明
能否请您告诉我如何也重定向HTTPS,而不会出现“太多重定向错误”
答案 0 :(得分:1)
现在可以正常工作了,我在同一force-redirect.conf
文件中的HTTP和HTTPS虚拟主机上使用了 RedirectMatch 表达式,如下所示:
<VirtualHost *:80>
ServerName support.nile.sd
RedirectMatch permanent (.*)/$ https://support.nile.sd/otrs/customer.pl
</VirtualHost>
<VirtualHost *:443>
ServerName support.nile.sd
RedirectMatch permanent (.*)/$ https://support.nile.sd/otrs/customer.pl
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/support.nile.sd/certificate.pem
SSLCertificateKeyFile /etc/letsencrypt/live/support.nile.sd/privatekey.pem
SSLCertificateChainFile /etc/letsencrypt/live/support.nile.sd/chainofgod.pem
</VirtualHost>
答案 1 :(得分:0)
您只有80端口的规则,这是常规的http://协议
我看不到端口443的规则,即https
您需要添加以下内容
context.Token