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

Last updated by Mihai Apetrei 1 year, 8 months ago.

Assigned support staff: Mihai Apetrei.

Author Posts
October 4, 2018 at 7:46 am #2786586


Hi guys,

Following up on this support request:

There really should be an option not to set a root page but for example provide a checkbox to activate a 301 redirect to the default language slug. A root page is cool to provide a custom language selection but it does not make sense if you want your visitors to see the home of the default language when languages in directories are enabled.

This really is basic multilingual functionality, already provided by so many frameworks, already ages ago. Please consider adding this to the WPML plugin too.

Thanks in advance.

// T

October 5, 2018 at 3:00 pm #2791179

Mihai Apetrei

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi Timothy and thank you for contacting WPML support!

If I understand correctly, you would want the main home page for the default language (/) to automatically redirect to the default language link (/en for example).

There is a workaround for this following the steps below.

1. Go to WPML -> Languages :
- Select "Directories with different languages".
- Activate "Use directory by default language".
- Select "HTML file"
- Enter "lang.php" within the text field

2. Activate redirection by browser language in WPML -> Languages

3. In the root folder of your WordPress installation, the same folder where the wp-config.php file is located:
- Create a new text file and name it "lang.php"
- Edit this file with a text editor and enter the following code (change the URL according to your site and your preferred language):

header( 'Location: <em><u>hidden link</u></em>' ) ; 

I suggest testing this with a browser in incognito mode to avoid cache problems.

Can you please let me know if this accomplishes what you expected?

October 5, 2018 at 4:55 pm #2791380


Hi Mihai,

I know there's a workaround (personally I prefere the one where you edit your htaccess file with 301 redirect rule there, it's much faster and it doesn't clutter your root dir), but my desire is that the WPML team considers this as a basic feature, configurable through the back-end, as an extra option below "Use directory by default language".


// T

October 8, 2018 at 7:31 am #2794913

Mihai Apetrei

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi Timothy!

Yes, I understand what you mean.

Thank you very much for your suggestion.

We added your idea to our feature list and will consider them.

If or when exactly our developers will add a new feature is not up to us to determine.

Each issue reported in, whether a bug or a new feature request, is taken seriously into consideration. It is given a high or low priority based on a number of factors. Factors which those with the overview of all things related are in the best position to determine.

Thank you once again.

Kind regards,