Salta la navigazione

Open

Reported for: WPML SEO 2.1.0

Topic Tags: Compatibility

Overview of the issue

If you are using Rank Math SEO plugin and its Remove base option in conjunction with WPML’s Different domains per language setting, it may lead to excessive redirections, resulting in the ERR_TOO_MANY_REDIRECTS error.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open …/wp-content/plugins/seo-by-rank-math/includes/modules/woocommerce/class-product-redirection.php file.
  • Look for line 139.
  • Replace:
    $link = trim( str_replace( Helper::get_home_url(), '', get_permalink() ), '/' );
    
  • With:
    // WPML -  Workaround for compsupp-7311
    $home_url = Helper::get_home_url(); 
    
    if ( 
    	Sitepress::get()->is_active() &&
    	$sitepress_settings['language_negotiation_type'] == 2
    ) {
    	$home_url = get_home_url();
    }
    
    $link = trim( str_replace( $home_url, '', get_permalink() ), '/' );
    

2 risposte a “Rank Math SEO - "Remove Base" Option Causes Redirection Issues”

Lasciare una risposta

Ti preghiamo di rimanere in tema e di essere rispettoso nei confronti degli altri. Se hai bisogno di aiuto per questioni non correlate a questo post, utilizza il nostro Forum di supporto per avviare una chat o inviare un ticket.

Potete usare questi tag:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>