Ich habe ein Ubuntu VPS und habe eine WordPress-Installation darauf eingerichtet. Ich habe auch eine Domain, deren Nameserver auf Cloudflares Nameserver eingestellt ist, alle DNS-Einstellungen sind auf Cloudflare und ich habe auch ein TLS-Zertifikat für Domain. Und ich habe Zertifikate auf meinem Server installiert. Ich habe den Umleitungsbefehl Redirect permanent/https://example.com/
in den ungesicherten virtuellen Host, dh Port 80, geschrieben. Wenn ich versuche, auf die Website zuzugreifen, wird ein Fehler example.com redirected you too many times.
Der virtuelle Host auf 80 ist
<VirtualHost *:80>
ServerAdmin webmaster@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot/var/www/html/example
Redirect permanent/https://example.com/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
und der virtuelle Host an Port 443 ist
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin admin@example.com
ServerName example.com:443
ServerAlias www.example.com
DocumentRoot/var/www/html/example
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/example.com.pem
SSLCertificateKeyFile/etc/ssl/private/example.com.key
<FilesMatch "\\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory/usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \\
nokeepalive ssl-unclean-shutdown \\
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
</IfModule>
Könnte jemand helfen?
Ihre Weiterleitungsschleife wird normalerweise von einem oder mehreren der Folgenden verursacht:
.htaccess
-Datei auf Ihrer HTPS-Site, die eine weitere Weiterleitung zurück an Port 80http://www.example.com
in wp-config.php