I have recently enabled SSL certificate and I'm tring to use it in my wordpress site. My website's url is
All plugings are disabled.
I replaced
define('WP_HOME','http://mywebsite.com');
define('WP_SITEURL','http://mywebsite.com');
with:
define('WP_HOME','https://mywebsite.com');
define('WP_SITEURL','https://mywebsite.com');
Here's what I get in http://www.redirect-checker.org:
301 Moved Permanently https://mywebsite.com/ 301 Moved Permanently https://mywebsite.com/ 301 Moved Permanently https://mywebsite.com/ 301 Moved Permanently
Problems found: Too many redirects. Please try to reduce your number of redirects for https://mywebsite.com. Actually you use 19 Redirects. Ideally you should not use more than 3 Redirects in a redirect chain. More than 3 redirections will produce unnecessary load on your server and reduces speed, which ends up in bad user experience.
A simple .txt file is working ok with https. For example:
https://mywebsite.com/license.txt
gives "200 OK" message and page is browsed via https normally.
But trying to browse .index.php (which includes wordpress) is giving "too many redirects" error.
I tried adding redirects to .htacess file but didn't work. I have read many articles about this issu but haven't managed to solve it. Can you help me please?
UPDATE
Here are the _SERVER variables, shown by phpinfo()
_SERVER["UNIQUE_ID"] WkOCLwoADAIAAFpxjJQAAAAG
_SERVER["QS_SrvConn"] 290
_SERVER["QS_AllConn"] 290
_SERVER["QS_ConnectionId"] 15143736798377620623491
_SERVER["HTTPS"] 1
_SERVER["HOME"] /home10a/sub002/sc11808-TCBG
_SERVER["HTTP_HOST"] mywebsite.com
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
_SERVER["HTTP_UPGRADE_INSECURE_REQUESTS"] 1
_SERVER["HTTP_ACCEPT"] text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate, br
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-US,en;q=0.9,el;q=0.8
_SERVER["HTTP_COOKIE"] wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_dbdaedf581c00cfca1e0c4de7c421d21=marketing%7C1514545975%7C91BD7fgU1i2AZl6rYQQ1cjIFfYkG2raYJp0VNXAIEHM%7C9a9f559abd4e30c57834d12a093683a1b6ff5dff14fbbf341983e1acee2fef58; wp-settings-3=mfold%3Do%26editor%3Dtinymce%26libraryContent%3Dbrowse%26galleryitemtype_tab%3Dpop%26hidetb%3D1%26wplink%3D0%26posts_list_mode%3Dlist%26imgsize%3Dfull; wp-settings-time-3=1514373177; redux_blast=1514373287; PHPSESSID=568be9d8e51767786dfc80915ff881a3; redux_update_check=3.6.7.13
_SERVER["HTTP_SSL"] on
_SERVER["HTTP_X_FORWARDED_FOR"] 78.108.43.18
_SERVER["HTTP_X_FORWARDED_HOST"] mywebsite.com
_SERVER["HTTP_X_FORWARDED_SERVER"] mywebsite.com
_SERVER["PATH"] /usr/local/bin:/usr/bin:/bin
_SERVER["SERVER_SIGNATURE"] <address>Apache Server at mywebsite.com Port 80</address>
_SERVER["SERVER_SOFTWARE"] Apache
_SERVER["SERVER_NAME"] mywebsite.com
_SERVER["SERVER_ADDR"] 10.0.12.2
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 77.232.66.255
_SERVER["DOCUMENT_ROOT"] /home10a/sub002/sc11808-TCBG/www
_SERVER["SERVER_ADMIN"] [no address given]
_SERVER["SCRIPT_FILENAME"] /home10a/sub002/sc11808-TCBG/www/info.php
_SERVER["REMOTE_PORT"] 45245
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.0
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"] /info.php
_SERVER["SCRIPT_NAME"] /info.php
_SERVER["PHP_SELF"] /info.php
_SERVER["REQUEST_TIME"] 1514373679
phpinfo();
, call it via https, look for the SERVER_PORT. If it's not 443, you are behind a reverse proxy. In that case, look for signs to recognize the forwarded protocol (X-Forwarded-Protocol is often used), then set$_SERVER["HTTPS"] = "on"
if those conditions are met.