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

Last updated by Bruno 2 months ago.

Assigned support staff: Bruno.

Author Posts
July 18, 2019 at 8:03 pm #4242157

Jose Luis

I am trying to:

Configure a site as:
my.domain.es/blog/ --- > main WP configuration site (spanish)
my.domain.com/blog/ --> second language

I found this post https://wpml.org/forums/topic/languages-in-domains-and-directories/#post-4242123 but as is closed I open it here.

I am having varios issues trying to setup the above config which I am now guessing is not supported. My second language images don't show on the backend "media". They seem correct but the src within the WP admin is concatenating domain-lang-1 to domain-lang-2 (??). Tried fixing it with https://wpml.org/forums/topic/different-domain-settings-are-not-valid/ but all the same. Our WPML translation plugin config page returns a 403.

I am no guessing this is simply unsuppported by WPML. Can you please reconfirm that this setup for two languages is not possible? It is showing as "valid" on the backend.

my.domain.es/blog/ --- > main WP configuration site (spanish)
my.domain.com/blog/ --> second language

If that is the case I find this a major limitation that other multilingual plugins like polylang do not have. I suggest you should include this as a feature to be resolved as I it's obviously fixable.

Any alternatives... any form of having different domains but not on the root directory?

thanks.

July 18, 2019 at 11:46 pm #4242577

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting us. This should work properly. In the case, from what I understand, you have set up both subdomains, and the secondary language you added as an alias, correct?

That is, by accessing any of the subdomains the site is displayed correctly? Have you tried deactivating all non-WPML plugins and verifying that the problem persists? Ideally only WPML plugins and the default theme (Twenty Nineteen) should be enabled so we can isolate the problem.

As it looks like you're using a local environment - based on the debug information you posted, I can not see the problem, however, this concatenation of "src" does not appear to be WPML. Maybe some cache plugin?

Thank you.

July 19, 2019 at 8:22 am #4244877

Jose Luis

Hi. We had WPML working more or less correctly under two subdirs... "/b/en" and "b/es". No issues initially.

We then changed the setup to what I mentioned on my question and the issues appeared. As explained we have two issues we can't figure out how to resolve.

IMAGES ON SECOND LANG
Images do not show on the backend's media list in the second language (eng). This is due to that the URL of the source is being constructed as "my.domain.com.local/b/cont/uploads//2019/..." notice there is no protocol in front or a / as there are on the main language spanish version "//". The image details seems fine and the URL works if I just add a protocol in front. Some screenshots attached.

TRANSLATION MANAGEMENT
hidden link returns constantly a 403 error. All the rest works. Deleted it and reactivated. Checked permissions. Activated debug... and can't see why the hell that is not working.

It makes no sense that this is related to "another" plugin considering that is purely a second language issue and only appeared when we started used domains under WPML. Also the error on the translation manager does not make any sense with othe plugins.

July 19, 2019 at 6:17 pm #4247833

Jose Luis

Further to my previous reply. We've now tested with the same result:

Deactivating all plugins
Reinstalling to a new database and activating only your WPML plugins.

We believe it could be an issue (the media missing images in the back at least) with the locations of directories. Our installation uses modified constants for content and plugin directories, defined in the conf. I have to assume that a mature project like this supports that and its not hardcoded to use "wp-content/plugins".

If we make those standart that part seems to work.

As for the 403 on the translation manager plugin we've noticed that some of the admin link requests seems to be missing:

wpml-translation-management/menu/settings
wpml-translation-management/menu/translations-queue.php
wpml-translation-management/menu/main.php

July 22, 2019 at 11:51 pm #4261721

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thanks for the detailed explanation. Please, would you send me the package from your site so that I can test in my test environment?

I see testing some possible combinations, but this works correctly in my testing environment. Maybe some other problem or even the corrupted database. In this case, it would be better if we could test in our test environment.

If you find this a good idea, you can use some plugin like Duplicator or All in One Migration and create a copy of your site and then use some service like Google Drive or Dropbox and share the link so we can test. If you want, let me know so that I can enable the private field for you to insert the link to download.

>>> We believe it could be an issue (the media missing images in the back at least) with the locations of directories. Our installation uses modified constants for content and plugin directories, defined in the conf. I have to assume that a mature project like this supports that and its not hardcoded to use "wp-content/plugins".

The WPML can use images in other directories. Once an image is uploaded, the full link is in the database. At the moment, the only things I can imagine are:

- Re-generate images (click on the WPML > Settings > Media translation > Start button)
- Regenerate the images completely again. You can use the "Regenerate Thumbnails" plugin (https://wordpress.org/plugins/regenerate-thumbnails/)

Using the tips above, does the problem still persist?

Thank you.

July 25, 2019 at 2:25 pm #4284193

Jose Luis

We've had to reinstall completely and after definining the uploads constant in the config seems to be working.

The 403 on the translation manager remains. Plugin reinstalled. Does this require for the site to be "accesible" from the internet? This is a local develop version.

July 30, 2019 at 6:49 pm #4310221

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Sorry for the delay. Glad to hear that the URLs now works.

>>> The 403 on the translation manager remains. Plugin reinstalled. Does this require for the site to be "accesible" from the internet? This is a local develop version.

That depends. By default, it should not be necessary but it can be. Maybe some plugin is trying to download some content and is failing.

In this case, error 403 is permission error (hidden link). Some directories may not have permission correctly so files can be created dynamically - such as language files.

Ideally, it would be interesting to test this on some server on the internet to see how it will behave. If the problem still persists, it would be an idea to upload the site so that our team could test.

Thank you.

August 1, 2019 at 3:56 pm #4323671

Jose Luis

Moved this install to production environment and same issue.

We've now figured is the way the links are built in the menu in the backend and only seems to affect your plugins:

FAILS (403)
hidden link

WORKS:
hidden link

Same happens with the actual settings menu of WPML

August 10, 2019 at 12:15 am #4373271

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

In this case "%2F" means "/", encoded. This works correctly in our test environment. You can check this link: hidden link

Maybe this is some configuration on your server? Have you checked if the issue persists with all non-WPML plugins disabled?

Thank you.

The topic ‘[Closed] Combine domain and subdir for languages’ is closed to new replies.