This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 2 replies, has 1 voice.

Last updated by Sven 3 months ago.

Author Posts
July 17, 2019 at 9:18 pm #4233559

Sven

I am trying to:
Get a POST of a subdirectory Blog, redirected by nginx into the sitestructure of my main site.
So mysite.de /blog -> proxy_passed wordpress installation.

Instead, I got:

ERR_TOO_MANY_REDIRECTS by is_permalink_part_of_request in \classes\query-filtering\class-wpml-query-parser.php

If the WP_SITEURL contains an additional Subdirectory, this function redirects infinite the same call to the same post.

i changed the function to :

	private function is_permalink_part_of_request( $permalink, $request_uri ) {
/* CHANGE START get rid of site_url */
        $permalink = substr( $permalink, strlen( get_option( 'siteurl' ) ) );
/* CHANGE STOP get rid of site_url */
		$permalink_path = trailingslashit( urldecode( wpml_parse_url( $permalink, PHP_URL_PATH ) ) );
		$request_uri    = trailingslashit( urldecode( $request_uri ) );
		return 0 === strcasecmp( substr( $request_uri, 0, strlen( $permalink_path ) ), $permalink_path );
	}

i'm cutting out the site url.

Maybe some others may need this information, if they try'd to proxy a wpml powered blog.

July 17, 2019 at 9:40 pm #4233611

Sven

closed

July 20, 2019 at 11:47 am #4249779

Sven

ok.
CORRECTION or best way to do:

if you want to proxy a wp system as subdirectory of an other system, work with the same subdirectory on your WordPress System

www .maindomain .com/anothersystem proxy_passed -> www .theothersystem .com/anothersystem

Install the other system as Subdirectory Siteurl.

Then WPML is working correctly with different Domains each language.

If possible, delete code above. (https://wpml.org/forums/topic/err_too_many_redirects-on-multi-domain-nginx-redirected-blog/#post-4233559)

Thx!