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

Last updated by boonyawatL 8 months, 2 weeks ago.

Assigned support staff: Bobby.

Author Posts
January 25, 2019 at 1:59 pm #3129236

maxd-11

A double directory-url is added when clicking the logo to go to the home page.

Reproduce:
1. Visit any page on the website (example: hidden link)
2. Click on the logo to go back to the home page

I expected to see:
hidden link

Instead, I got:
hidden link

A screenshot of the settings I'm using are attached.

Thanks in advance for your help!

January 25, 2019 at 9:50 pm #3130616

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

please verify that both SiteURL and HomeURL are set with the same URL

additionally, i believe you might not need to add the /nl within the URL for HomeURL since WPML will be adding this automatically and if you decide to leave it there add a forward slash "/nl/" afterwards and that might stop that extra /nl from being added but do test with the SiteURL and HomeURL both being set to hidden link only and let me know your results

January 25, 2019 at 10:02 pm #3130624

maxd-11

Hi Bobby,

Thanks for your reply.
Could you specify where I can verify the SiteURL and HomeURL?
Wordpress (or WPML) automatically adds the first /nl behind the link to the homepage. I can't manually change that.

Kind regards,
Max

January 26, 2019 at 5:45 am #3131088

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi ,

Please go to your database table wp_options , it should be the first 2 entries

also within WP=>Settings->General you should be able to see the entries

let me know your results please

January 26, 2019 at 8:54 am #3131235

maxd-11

Hi Bobby,

I was able to find "Wordpress address" and "Site address", both of them seem correct. I can't access the database here. Any tips to change (or find) the home URL?

Kind regards,
Max

January 28, 2019 at 7:01 pm #3137284

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

If possible i would like to take a closer look

**Before we proceed I recommend to please take FULL BACKUP of your database and your website.**
I often use the Duplicator plugin for this purpose See: http://wordpress.org/plugins/duplicator/

I would like to request temporary access (wp-admin and FTP) to your site

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.

January 30, 2019 at 7:57 am #3142503

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

Thank you for providing the access details !

after further testing i can see that the /nl directory remains even after the directory has been deactivated within the WPML-.Languages page for the default language.

at the meantime while we are debugging this issue i suggest using "Naam van de taal toegevoegd als een parameter" .

i have currently migrated the site to our cloudways staging server for further testing , i will be updating you as soon as i have some results

this will not interfere with your live site.

January 30, 2019 at 8:28 pm #3145610

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

after further debugging i have concluded the following

the issue must stem from within your installation of WP as i can see TransIP has added quite some changes in wp-config.php my guess is that they might have added in your installation causing the trailing slashes '/' to not be enforced

you can see for example when you hover over the language switcher at the bottom the url shows as hidden link the trailing slash is missing , should show as hidden link

even with WPML deactivate this issue remains , for example it will be hidden link instead of hidden link

This causes redirections ,thus adding /nl/ twice on your url

[this documentation explains why WPML picked up on it as well
https://wpml.org/errata/changes-in-the-way-wpml-handles-the-trailing-slashes-in-url-conversion/]

to resolve this i went to your .htaccess file and added the following on the top

# Force trailing slash
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ hidden link{HTTP_HOST}/$1/ [L,R=301]

this now resolved the issue but i suggest contacting your host provider regarding this.

let me know your results please

January 30, 2019 at 9:09 pm #3145677

maxd-11

Hi Bobby,

Thanks for taking a look & debugging the problem. It's clear what's happening!

The script you've added to the htaccess creates an infinite redirect loop for other pages than home in all languages (for example: hidden link).

If that's fixable, I'm very happy! Also does the script support https?

Kind regards,
Max de Mooij

January 30, 2019 at 9:55 pm #3145736

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Therefore the script i did add does not work well as a fix in this case.. it might fix the homepage issue but the rest of the pages get a redirect now.

you can remove it from your .htaccess or i can remove it for you.

the main issue that needs to be resolved is why your environment is not adding a trailing slash / with WPML activated or not activated , that is not correct and that would resolve this issue at the source.

that is why i recommended contacting your host provider

January 31, 2019 at 5:23 pm #3149061

maxd-11

Ultimately it was about adding a trailing slash in the permalinks. "/blog/%post_id%/", rather than "/blog/%post_id%". Stupidly simple solution!

May 13, 2019 at 3:54 pm #3800341

boonyawatL

"Ultimately it was about adding a trailing slash in the permalinks. "/blog/%post_id%/", rather than "/blog/%post_id%". Stupidly simple solution!"

This does fix the problem!! But now I have / on every webpage. I rather not to have / at the end. Any help is appreciated. Thank you