Bỏ qua điều hướng

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 phản hồi sang “Rank Math SEO - "Remove Base" Option Causes Redirection Issues”

Để lại câu trả lời

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

Bạn có thể sử dụng các thẻ này:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>