Hey Guys, I’m new to WordPress, I have my website that I’m locally hosting it on WordPress. I have an issue where the website becomes unreachable it says too many redirect. I found a fix which is applying the below code to functions.php under themes
function disable\_front\_page\_redirects($redirect\_url) {
if( is\_front\_page() ) {
$redirect\_url = false;
}
return $redirect\_url;
}
add\_filter( ‘redirect\_canonical’, ‘disable\_front\_page\_redirects’ );
While the issue gets fixed but after sometime the code gets removed automatically from the functions.php file even though I disabled all plugins auto-update. Then I have to copy paste the code again.
Does anyone know how I can permanently fix this too many redirect issue?
[ad_2]
That isn’t a fix – it’s a band-aid – the redirect problem still exists. Fix the ACTUAL problem – what’s causing the redirect. Wild guess – your SSL isn’t configured properly / you’re using Cloudflare and didn’t set the SSL to “strict”.
Investigate the cause of the redirect – check the headers when you load the homepage. Look for any rules in your htaccess. Look for the “Redirection” plugin.