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

Last updated by desmondN 5 days, 23 hours ago.

Assigned support staff: Riffaz.

Author Posts
October 3, 2019 at 3:39 am #4684417

desmondN

I have recently updated my settings to reflect /en at the back of my URL. However, if I use my homepage URL without /en, it will not redirect to the homepage. Also, the redirection plugin don't work because /en technically is not a valid URL.

October 3, 2019 at 5:54 am #4684733

Riffaz
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support.

This is because your home url and the site url are not same: hidden link
Make them same in Setting > General : hidden link
Make this change and your site will work as you expect.

Let me know how it goes.

Regards,
Riffaz.

October 3, 2019 at 6:38 am #4684827

desmondN

Hi Riffaz,

But they are the same : hidden link

Do I need to set them with /en or without /en, so that if people key in without /en, it will direct to the one with /en ?

October 3, 2019 at 7:57 am #4685531

Riffaz
Supporter

Languages: English (English )

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

Hi,

Ok, so now you updated the links there.

Do I need to set them with /en or without /en, so that if people key in without /en, it will direct to the one with /en ?
- yes

Let me know how it goes.

Regards,

October 3, 2019 at 7:59 am #4685535

desmondN

Hi Riffaz,

You are not answering my question.
Do I set them both to URL/en or just URL?

I want my visitor to key in just my domain name, but they will still be redirected to URL/en

October 3, 2019 at 8:18 am #4685695

Riffaz
Supporter

Languages: English (English )

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

Hi,

Yep.
Kamu kena tukar URL macam ini : hidden link
So, kalau user buka hidden link dia orang akan pergi ke hidden link automatik..
sila cuba dan bagi tau.

sekian,

October 3, 2019 at 8:32 am #4685837

desmondN

Hi Riffaz,

Maaf, tidak dapat lagi. Kalau saya tukar ke hidden link, website akan jadi hidden link. WP-admin saya pun tidak boleh login.

Saya kena masuk ke dalam wp-config:

define('WP_HOME','<em><u>hidden link</u></em>');
define('WP_SITEURL','<em><u>hidden link</u></em>');

Baru dapat guna hidden link. Tapi, hidden link masih lagi kosong

October 3, 2019 at 11:20 am #4687111

Riffaz
Supporter

Languages: English (English )

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

Hi,

terima kasih untuk percubaan.

Kalau kamu pilih option "different languages per directories" masti kena pakai root page: https://wpml.org/wp-content/uploads/2013/09/directory-for-default-language.png
Itu yang wajib: https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/

Selapas itu, kalau kamu nak redirect ke hidden link automatik bila user datang ke homepage, sila baca: https://wpml.org/forums/topic/redirect-a-root-page-to-language-code-as-default-home-page/#post-2778130

Sekian,

October 3, 2019 at 2:36 pm #4688827

desmondN

Maksudnya, saya tidak boleh guna hidden link sebagai root page saya? Mesti ada satu page lagi sebelum sampai hidden link ?

Saya sudah cuba guna plugin untuk buat redirection, plugin tidak accept, cakap link is not valid.

October 6, 2019 at 1:05 pm #4702527

Riffaz
Supporter

Languages: English (English )

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

hi,

Maksudnya, saya tidak boleh guna hidden link sebagai root page saya? Mesti ada satu page lagi sebelum sampai hidden link ?
- yep

Sila cuba method ini: https://wpml.org/forums/topic/language-url-format-33/#post-4581883
buat a page dgn redirect rules
pilih tu dlm root page option.

yang ini sudah help untuk ramai orang:

"If you want to force the primary language to display as hidden link (or anything you want) you will need to set up a redirect. To do that, please create a page template in your theme (or in a child theme) with the following content:

<?php
/*
Template Name: Root redirect
*/
wp_redirect( home_url() );
exit;
?>

use the correct url you want in the code above.

Then select this template for the root page in the WordPress page editor."

October 7, 2019 at 3:08 am #4704035

desmondN

Hi Riffaz,

I have already followed your instructions above, but still not working.

Uploaded a root.html doc:

<html>

<?php
/*
Template Name: Root redirect
*/
wp_redirect( home_url(<em><u>hidden link</u></em>) );
exit;
?>

</html>

Also updated the setting in Translation : hidden link

October 7, 2019 at 8:42 am #4705619

Riffaz
Supporter

Languages: English (English )

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

Hi,

Your code is wrong and you should use the absolute path here: hidden link

Let me know your site login details and the FTP login details.
The next reply is private.

Regards,

October 7, 2019 at 8:43 am #4705623

Riffaz
Supporter

Languages: English (English )

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

** setting the next reply as private.

October 7, 2019 at 11:07 am #4706497

Riffaz
Supporter

Languages: English (English )

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

Hi,

Unable to connect via FTP: hidden link
Do you have cPanel?
If yes, let me know. the next reply is private.

Regards,

October 8, 2019 at 3:37 pm #4716925

Riffaz
Supporter

Languages: English (English )

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

Hi,

Can I get your database access details please?
The next reply is private.

And, actually your site works as it should.
for the default language homepage you can not have that language folder in the url.
Your site default language is English.
So hidden link is English.
You can not change it to /en/

Eg: here also the default language is English hidden link and this site can not have /en/ as well.

Regards,