Support » Plugin: Remove Category URL » loop of 301 redirects when polylang is used

  • when redirecting from old category and there is polylang plugin used.

    i would fix redirect_old_category_url like this:

    public function redirect_old_category_url( $query_vars ) {
    	if ( isset( $query_vars['rcb_category_redirect'] ) ) {
    		if (function_exists('pll_home_url')) {
    			$home = pll_home_url();
    		} else {
    			$home = get_option( 'home' );
    		}
    		$category_link = trailingslashit( $home ) . user_trailingslashit( $query_vars['rcb_category_redirect'], 'category' );
    		wp_redirect( $category_link, 301 );
    		exit;
    	}
    	return $query_vars;
    }

    https://wordpress.org/plugins/remove-category-url/

  • The topic ‘loop of 301 redirects when polylang is used’ is closed to new replies.