Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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

Last updated by Adam 2 weeks, 5 days ago.

Assigned support staff: Bigul.

Author Posts
November 4, 2019 at 5:01 pm #4883395

Adam

Hello,

My site has two languages (English - default, and French - secondary). I have one URL set up per language:
hidden link
hidden link

I want English users to always see "hidden link" for the starting part of their URL. French users should see "hidden link".

This already works correctly on inside pages, but the French homepage ("hidden link") keeps redirecting me to "hidden link".

How can I made the French homepage say "hidden link"?

Attached is an image of my permalink and WPML language settings.

Also, here is code in the root page I have put in myself that could be affecting this:

$lc = "";

if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
$lc = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);

if($lc == "fr"){
header("location: en/");
exit();
} else if($lc == "fr"){
header("location: fr/");
exit();
}
else{
header("location: en/");
exit();
}

November 6, 2019 at 1:03 pm #4898459

Bigul
Supporter

Languages: English (English )

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

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

Please remove the current code you are using after a site backup. Then try the following steps and let me know your feedback.

1) Go to WPML>>Languages>>Language URL format
2) Choose *HTML file* option of *Use directory for default language* section
3) Create a new PHP file *root-page.php* and place it in *Root folder* of the site
4) Add the following code in *root-page.php* file and save the changes(please change the URL in the code)

<?php

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

?>

5) Add *root-page.php* as the value for *HTML file* field
6) Save the settings

Please check the following documentation and image URL for more details.

https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/#selecting-an-html-file

--
Thanks!

Bigul

November 18, 2019 at 4:08 pm #4966739

Adam

My issue is resolved now. Thank you!