too many redirects wordpress code example

Example 1: ERR_TOO_MANY_REDIRECTS wordpress

# update wp-config file
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

#also add
define('FORCE_SSL_ADMIN', true);
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
    $_SERVER['HTTPS']='on';

Example 2: wordpress https too many redirects

define('WP_HOME','https://mywebsite.com');
define('WP_SITEURL','https://mywebsite.com');
$_SERVER['HTTPS'] = 'on';

Example 3: too many redirects wordpress

Issue was solved by removing the .htaccess file as .htaccess files was containing

Order Allow,Deny
Deny from all



reference : 
https://cwiki.apache.org/confluence/display/HTTPD/ClientDeniedByServerConfiguration

Example 4: wordpress This page isn’t workingnewconstructionslondon.co.uk redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Tags:

Misc Example