WPML

문제 개요

상품카테고리에서 상품 카테고리 번역을 수동으로 편집할 때, (슬러그가 아닌) 카테고리 설명/텍스트만 변경된 경우에도 Yoast SEO Premium이 301 리디렉션을 잘못 생성했습니다.

생성된 리디렉션의 URL 형식이 잘못되었습니다:

이전 URL: http://site.com/product-category/test-es-wpml

새 URL: http://site.com/http://es.site.com/product-category/test-es-wpml/ (이중 URL!)

참고: 이는 시각적인 오류이며, 이 리디렉션은 네비게이션 문제를 일으키지 않습니다

임시 해결 방법

이 문제는 해결되었습니다. 최신 버전으로 업데이트하면 사이트에서 이 문제가 해결되므로, 아직 업데이트할 수 없는 경우에만 이 임시 해결 방법이 필요합니다.

진행하기 전에 전체 사이트 백업을 완료했는지 확인하세요.

  • …/wp-content/plugins/wordpress-seo-premium/classes/term-watcher.php 파일을 여세요.
  • “protected function get_target_url(” 함수를 찾으세요. 241번째 줄 근처에 있습니다.
  • 다음 코드를:
    PHP
    protected function get_target_url( $tag, $taxonomy ) {
        // Get the term link.
        $term_link = get_term_link( $tag, $taxonomy );
    
        // Return early if the term link is not a string, i.e. a WP_Error Object.
        if ( ! is_string( $term_link ) ) {
            return '';
        }
    
        return str_replace( home_url(), '', $term_link );
    }
  • 다음으로 변경하세요:
    PHP
    protected function get_target_url( $tag, $taxonomy ) {
        // Get the term link.
        $term_link = get_term_link( $tag, $taxonomy );
    
        // Return early if the term link is not a string, i.e. a WP_Error Object.
        if ( ! is_string( $term_link ) ) {
            return '';
        }
    
        // Extract the path to handle WPML subdomain URLs (matches post-watcher behavior).
        $url = wp_parse_url( $term_link );
        if ( is_array( $url ) && isset( $url['path'] ) ) {
            return $url['path'];
        }
    
        return '';
    }

모든 알려진 문제

여전히 이 문제가 발생합니까?

업데이트해도 문제가 해결되지 않으면 지원 문의를 하세요. 함께 살펴보겠습니다.