跳过导航

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 所有回复 给 “Rank Math SEO - "Remove Base" Option Causes Redirection Issues”

留下回复

紧扣主题并尊重他人。如果您需要帮助解决与本帖无关的问题,请使用我们的 Support Forum 开始聊天或提交票据。

您可以使用这些标签:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>