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.

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by toonC 2 months, 1 week ago.

Assigned support staff: Carlos Rojas.

Author Posts
August 6, 2019 at 2:21 pm #4348303

toonC

Hi

I have a question about this page from the documentation:
https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/

We have a website in multiple languages and we want domain.com to redirect to domain.com/nl/
Now I'm using a php-file located in the public_html with the following code:

<?php
    header("HTTP/1.1 301 Moved Permanently"); 
    header("Location: /nl/"); 
    exit();
?>

WPML configuration:
Language URL format
Different languages in directories
Use directory for default language
HTML file: my-php-file.php

This setup is working.
But unfortunately this is causing problems with Gravity Forms multi file upload.
The issue is similar to this: https://wpml.org/forums/topic/gravity-forms-file-upload-not-working-on-translated-versions-of-the-site/

Can you please tell me what the best practise is for "Different languages in directories" (including the default language)
If my approach is correct, can you tell me how to solve the Gravity Forms issue?

Thanks.

August 6, 2019 at 4:19 pm #4349515

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

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

Hello,
Thank you for contacting WPML support.

1.- I would like to request temporary access (wp-admin and FTP) to your site to take better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

2.- Please increase the PHP Memory Limit. Minimum requirements are 128Mb: https://wpml.org/home/minimum-requirements/
You can add this to wp-config.php to increase WP memory:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '128M');
define( 'WP_MAX_MEMORY_LIMIT', '128M' );

- Add it above the line /* That's all, stop editing! Happy blogging. */

Kind regards,
Carlos

August 8, 2019 at 11:00 am #4362089

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

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

Hi there,
Thank you very much for the information provided.

If instead of using 'HTML file' option you select 'A page' options in WPML -> Languages -> Language URL format, does the issue persists?

Regards,
Carlos

August 9, 2019 at 8:22 am #4368665

toonC

Hi

I've switched from "html file" to "a page" and created a landing page.

This indeed solves the Gravity Forms issue,
but we rather do not want to do that.
When surfing to domain.com we would like a redirect to domain.com/nl/
Is this possible?

August 9, 2019 at 10:56 am #4369583

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

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

Hi,

If you use the option of a page as a root page and then add a 301 redirect using a plugin like: https://wpml.org/plugin/redirection/
Does this solves the issue?

Regards,
Carlos

August 12, 2019 at 9:53 am #4379879

toonC

Hi

This indeed solves this issue.
The redirect is working and the Gravity Forms issue is solved.
Is using the redirection plugin alway the preferred approach?
Or is the php file still the preferred approach? (if there are no issues)

Best regards

August 12, 2019 at 11:27 am #4380371

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

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

Hi,

Both options are correct, however the preferred one would be using the root page and the redirection.

Regards,
Carlos

August 12, 2019 at 1:18 pm #4381245

toonC

Hi

Ok, thanks for the advise.
I'll close this topic now.

Best regards

August 12, 2019 at 1:20 pm #4381249

toonC

Hi

Ok, thanks for the advise.
I'll close this topic now.

Best regards