我在 httpd.conf 中使用此代码
<VirtualHost *:4080>
# This will enable the Rewrite capabilities
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
ServerAdmin serveradmin
DocumentRoot "/etc/zpanel/panel/"
ServerName panel.mydomain.com
ServerAlias *.panel.mydomain.com
AddType application/x-httpd-php .php
<Directory "/etc/zpanel/panel/">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
我需要http://domain.com:4080重定向到安全的://domain.com:4080,这正在发生但证书不起作用
如果我删除自动重定向代码
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) [https://%{HTTP_HOST}%{REQUEST_URI}][1]
并 goto secure: //domain.com:4080 在浏览器我自己的证书中出现。
我需要像 cpanels 自动重定向到 https 之类的东西