Я знаю, что есть много подобных вопросов, но ни один не дал мне ответа, который решил мою проблему с моим WordPress wp-admin / page, браузер выдает ошибку ERR_TOO_MANY_REDIRECTS, я отключил все плагины, очистил кеш икуки, отредактировал мой файл wp-config.php, но все еще ничего.
моя конфигурация apache:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
Redirect permanent / "https://example.com/"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www>
AllowOverride None
Order Allow,Deny
Allow from All
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{HTTP:Authorization} .
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 307 ^/$ /index.php
</IfModule>
</IfModule>
</Directory>
</VirtualHost>
</IfModule>
моя wp-config.php
define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');
/** SSL */
define('FORCE_SSL_ADMIN', true);
if((empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS'] = 'on';
моя переменная $ _SERVER:
Array
(
[SERVER_SOFTWARE] => Apache/2.4.29 (Ubuntu)
[REQUEST_URI] => /wp-admin/?test=1
[REDIRECT_HTTPS] => on
[REDIRECT_SSL_TLS_SNI] => example.com
[REDIRECT_STATUS] => 200
[HTTPS] => on
[SSL_TLS_SNI] => example.com
[HTTP_HOST] => example.com
[HTTP_CONNECTION] => keep-alive
[HTTP_UPGRADE_INSECURE_REQUESTS] => 1
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36
[HTTP_DNT] => 1
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
[HTTP_ACCEPT_ENCODING] => gzip, deflate, br
[HTTP_ACCEPT_LANGUAGE] => es-ES,es;q=0.9,en;q=0.8,pt;q=0.7
[HTTP_COOKIE] => PHPSESSID=84c3jbfdtbmcl4jnibgobm3666
[PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[SERVER_SIGNATURE] =>
Apache/2.4.29 (Ubuntu) Server at example.com Port 443
[SERVER_NAME] => example.com
[SERVER_ADDR] => xxx.xxx.xxx.xxx
[SERVER_PORT] => 443
[REMOTE_ADDR] => xxx.xxx.xxx.xxx
[DOCUMENT_ROOT] => /var/www
[REQUEST_SCHEME] => https
[CONTEXT_PREFIX] =>
[CONTEXT_DOCUMENT_ROOT] => /var/www
[SERVER_ADMIN] => [no address given]
[SCRIPT_FILENAME] => /var/www/index.php
[REMOTE_PORT] => 52242
[REDIRECT_URL] => /wp-admin/
[REDIRECT_QUERY_STRING] => test=1
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] => test=1
[SCRIPT_NAME] => /index.php
[PHP_SELF] => /index.php
[REQUEST_TIME_FLOAT] => 1550424580.519
[REQUEST_TIME] => 1550424580
)