Skip Navigation

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 17 replies, has 2 voices.

Last updated by davidH-95 1 year, 9 months ago.

Assigned support staff: José Arcos.

Author Posts
June 28, 2018 at 10:45 am #2440692

José Arcos

Hello, thanks for the info. I passed this answer to our developers. I'll be working with them in order to find a solution as soon as possible.

Thanks for your patience.

July 12, 2018 at 3:24 pm #2490087

José Arcos

Hello again,

I get an answer from our 2nd tier support:

The issue is with wp_safe_redirect() (core function) that we call.

If that function is not filtered properly - then it allows only the same domain as set in the settings.

And because it is a separate domain - it redirects to /wp-admin for the current domain.
I think this is a custom coding work that could be potentially hacked like this:

function mytheme_do_not_redirect_city_post_type( $redirect, $post_id, $query ) {
    if ( $GLOBALS['_SERVER']['HTTP_HOST'] === 'bergfuehrer-davosklosters.ch') {
       return false;
     }
    return $redirect;
    };
add_filter( 'wpml_is_redirected', 'mytheme_do_not_redirect_city_post_type', 10, 3 ); 

This should disable the redirect.

It is also possible to filter wp_safe_redirect, by filtering "allowed_redirect_hosts" as mentioned here: https://codex.wordpress.org/Plugin_API/Filter_Reference/allowed_redirect_hosts

Please let me know if this solves the issue or if you need further details.

Have a good day.

November 26, 2018 at 11:06 am #2939709

davidH-95

Hello again,
We are starting now with translating. The redirect to wp-admin is resolved now with your filter above.

For all "angebote" within the domain hidden link we can not switch to the english translation. It's only showing the german original instead.

Try this (language switcher at the bottom of the page):
hidden link

Or this (language switcher at the bottom of the page):
hidden link

Thanks a lot for your help.
David