Wordpress "redirected too many times" problem but only homepage url

kakoo

duplicate of @Pdnew, @parijha, @oldeone, @dreckson
Banned User
Nov 11, 2020
59
17
8
hello everyone i recently migrated my website from one host to another host (ionos to plesk vps), using all in one migration plugin website migrated successfully but the website homepage URL showing "too many redirect" the problem is the only homepage url is not working specficaly but all my website pages, url, posts and wordpress dashboard loading correctly.

I am using cloudflare for dns & ssl, elementor, woocommerce etc in my website, When I shift my website back to old IP (host), the website works but in new host website homepage url not working.

the website only works when i disable the cloudflare proxy so that means the problem is coming from the cloudflare

fix i try:

Changing the site url
Changing cloudflare ssl mode to full, flexible and full strict
creating default htaccess file
i try to open website in incoginito mide and another device
disabling the plugins ets (but nothing working for me)

If anyone can help me with this it would be greatly appreciated
 

KomissarMinsky

Active member
Nov 13, 2018
339
128
43
check both your htaccess and php.ini files for embedded redirects from the old ionos hosting system.
I've found that many many managed wordpress hosts embed commands relative ot only their hosting into those files; causes no end of issues.
Also check and ensure that any MU plugins (Must Use) from previous hosts have been removed by your new host.
Hope this helps!~!
 

kakoo

duplicate of @Pdnew, @parijha, @oldeone, @dreckson
Banned User
Nov 11, 2020
59
17
8
check both your htaccess and php.ini files for embedded redirects from the old ionos hosting system.
I've found that many many managed wordpress hosts embed commands relative ot only their hosting into those files; causes no end of issues.
Also check and ensure that any MU plugins (Must Use) from previous hosts have been removed by your new host.
Hope this helps!~!
thanks for suggestion bro but i already done this
 

Stealth

Member
Mar 18, 2021
51
13
8
Try insert this in to wp-config.php:
if ((isset($_ENV["HTTPS"]) && ("on" == $_ENV["HTTPS"]))
|| (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "1") !== false))
|| (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "on") !== false))
|| (isset($_SERVER["HTTP_CF_VISITOR"]) && (strpos($_SERVER["HTTP_CF_VISITOR"], "https") !== false))
|| (isset($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"], "https") !== false))
|| (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_X_FORWARDED_PROTO"], "https") !== false))
|| (isset($_SERVER["HTTP_X_PROTO"]) && (strpos($_SERVER["HTTP_X_PROTO"], "SSL") !== false))
) {
$_SERVER["HTTPS"] = "on";
}

Then restart webserver when it needed.
 
Last edited:

hashkiller

Well-known member
Babiato Lover
GiveAway Master
Nov 24, 2019
357
490
93
Try so DM me my guy I have had the same problem way back.
 

kakoo

duplicate of @Pdnew, @parijha, @oldeone, @dreckson
Banned User
Nov 11, 2020
59
17
8
Try insert this in to wp-config.php:
if ((isset($_ENV["HTTPS"]) && ("on" == $_ENV["HTTPS"]))
|| (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "1") !== false))
|| (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "on") !== false))
|| (isset($_SERVER["HTTP_CF_VISITOR"]) && (strpos($_SERVER["HTTP_CF_VISITOR"], "https") !== false))
|| (isset($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"], "https") !== false))
|| (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_X_FORWARDED_PROTO"], "https") !== false))
|| (isset($_SERVER["HTTP_X_PROTO"]) && (strpos($_SERVER["HTTP_X_PROTO"], "SSL") !== false))
) {
$_SERVER["HTTPS"] = "on";
}

Then restart webserver when it needed.
thanks but this also not working for me, i finally tired and didn't find any solution of this problem so i turned off the cloudflare proxy and now i am using let's encrypt certificate for https Which we can install for free from plesk panel, the only problem is that now I am not able to take advantage of cloadflare's feature.
 

kakoo

duplicate of @Pdnew, @parijha, @oldeone, @dreckson
Banned User
Nov 11, 2020
59
17
8
I've Had It Before And I Do It And Clear Browser Cache , Plugin Cache If Yes And Enable Developer Mode In Cloudflare
yep ryt, I had the same problem before with my other sites but at that time changing the site url and changing ssl mode used to fix but this time nothing is understandable, only homepage url (example.com) shows redirect loop and others URLs works like wordpress login post url etc.
 

nwrk

Member
Oct 21, 2020
50
41
18
if still relevant

this code snippet on begging of wp-config.php will make it.
Make sure to include https:// or http:// based on your domain / setup.
Also if using any form of cache - clear them after the change.

The setup bellow force wordpress to home and site url as defined overiding any plugin changing.

Code:
cat sites/localhost/html/wp-config.php
<?php
define( 'WP_CACHE', true );
define('FS_METHOD', 'direct');
define('WP_HOME','https://yourwebsite.com');
define('WP_SITEURL','https://yourwebsite.com');

Hope it helps
 

skypeleft

Active member
Aug 10, 2019
401
71
28
define('WP_HOME','https://yourwebsite.com');
define('WP_SITEURL','https://yourwebsite.com');

In wp-config.php
 
  • Like
Reactions: kakoo

zzn

Member
Banned User
Jul 27, 2022
89
8
8
check both your htaccess and php.ini files for embedded redirects from the old ionos hosting system.
I've found that many many managed wordpress hosts embed commands relative ot only their hosting into those files; causes no end of issues.
Also check and ensure that any MU plugins (Must Use) from previous hosts have been removed by your new host.
Hope this helps!~!

True. Managed hosts suck.
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu