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

Last updated by Raja Mohammed 5 months, 3 weeks ago.

Assigned support staff: Raja Mohammed.

Author Posts
May 1, 2019 at 4:35 am #3715927

viktorsL

I am trying to: use my own .html file for my landing and beta.haliks.lv/en/ and beta.haliks.lv/ru/ pages and everything works great if I do not install WPML. When I install WPML my index.html files stop loading from these folders.

Link to a page where the issue can be seen: beta.haliks.lv/en/

I expect WPML to ignore translations for landings which wpml is looking for and use the index.html from server directories. But I want to use woocommerce pages translations and woocommerce multilingual.

Instead, despite the fact that I have folder structure on my server (root/en/ and root/ru/) with index.html WPML ignores it.

May 1, 2019 at 6:06 am #3716163

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi there,

Please confirm whether you have Different languages in directories option enabled in Language URL section under WPML > Language. If you have those enabled for your language then a similar directory with language code should not exist in your root directory as well. This will conflict with WPML setting and it would result in a 404 error.

Please refer to the common mistakes while enabling Directory for languages option https://wpml.org/faq/server-setting-for-languages-in-directories/#common-mistakes

Since WPML creates virtual directories creating a real directory will not work,

Please let me know if you need further assistance.

Kind regards
Raja

May 1, 2019 at 6:45 am #3716263

viktorsL

Yes! I have Different languages in directories option enabled. That is the point. I want directory structure to work with woocommerce pages, and to use my custom html pages for the landing pages.

May 1, 2019 at 8:56 am #3717099

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Do you mean you want a custom landing page for each directory?
I'm afraid That is not possible and if you try it will conflict with the WPML directory URL setup.
Unfortunately, there is no workaround for your case.

Kind regards
Raja

May 1, 2019 at 9:09 am #3717161

viktorsL

Yes. I want to use great wpml functionality for woocommerce pages only. I want to disable it for my other pages, because I have them in root/en/ and root/ru/ as index.html files that are already translated. I do not understand why I can not do that... It is not possible in any way?

May 1, 2019 at 3:45 pm #3718811

viktorsL

As for other people having the same issue I recomend using multisite with subdirectories! I am unsatisfied that I found this solution without any help from this support.

May 2, 2019 at 6:25 am #3722069

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

HI,

Glad you found a solution for your issue, I will document your solution for other users.
Honestly, I didn't think about this solution, Kindly apologize I couldn't help much with your issue.

Kind regards
Raja

May 2, 2019 at 6:50 am #3722149

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

I checked your site again, There are some limitations with using Multisite, The multisite will create two different unrelated sites, However for WPML to function properly please follow the steps in the documentation on how to make WPML work with multisite.
https://wpml.org/documentation/support/multisite-support/languages-in-domains-for-wordpress-multisite-mode/

As far as I see in your current setup the translation needs to be created as a separate product which is not linked to each other, Making the multisite setup work with WPML will again break the index.html.

I am not sure this is achievable, I would be very much happy if it works for you.

There is a workaround you can try in the code, Create a front-page.php file in your WordPress installation which and load the index.html file inside the file. use the WPML language constant to check for the current language and load the index file accordingly.

example code:

if ( ICL_LANGUAGE_CODE == 'en' ) {
 include( ' path to index.html file for english') 
}
if ( ICL_LANGUAGE_CODE == 'ru' ) {
 include( ' path to index.html file for ru language') 
}

I think this is the only way to achieve your desired results.

Please let me know the results.

Kind regards
Raja