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 4 replies, has 1 voice.

Last updated by alexandruC-8 1 year, 8 months ago.

Author Posts
October 3, 2018 at 4:00 pm #2785161


Hi, based on the topic i found here:

I added the code in my functions.php because of the errors I was getting with the secondary domain when trying to submit the contact form.

The problem I have now is that I can't redirect the user to a success page if I disabled AJAX for contactform7.

How can I have multiple domain working contactform7 with redirection on success?

October 3, 2018 at 5:12 pm #2785368


After digging around some more I can see that all the Javascript on the second domain is being loaded from the first, causing these issues. I am guessing that this problem is caused by WMPL, not rewriting the source code correctly.

Is there any setting for this?

October 3, 2018 at 5:23 pm #2785375


Here is the problem that I am having attached to this image. It seems that the javascript and all site's JS and CSS are loaded from the main domain, instead of the secondary domain.

How can I overcome this?

October 4, 2018 at 7:45 am #2786574


I have found why I get these errors. It seems that WPML is keeping the primary domain for the JSON string. Check attached

October 4, 2018 at 8:39 am #2786712


I found the fix after hours and hours of searching. Add:
add_filter( 'rest_url', 'wpml_permalink_filter' );

In your functions.php and the url of the JSON post will start working.