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 thread is resolved. Here is a description of the problem and solution.

Problem: How to use the language code in the default language URL too.

Solution: https://wpml.org/forums/topic/how-to-show-default-language-url-tag/#post-896123

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by brunoD-31 1 year ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
September 27, 2018 at 8:10 am #2769636

brunoD-31

Hi,

I'm setting up the language URL format for hidden link.
The standard language is English, second language is Dutch.

What I want, is the option 'different languages in directories'.
The thing is, for the English pages I also want /en/ to appear in all my urls (not only in the Dutch pages). Also the home page should be hidden link

Here's an example of another website (with languages NL and FR) that shows how I would like it to be: hidden link

Could you tell me step by step what to do?
Do I need to select HTML file or create a root page? I'm not sure how this works.

I also read I need to adjust my permalinks for this setting to work? The current settings are 'post name'.

Thank you very much!

Riane

September 28, 2018 at 3:07 am #2772447

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to assist you further on this issue.

Please follow the steps as mentioned in the ticket to solve the issue: https://wpml.org/forums/topic/how-to-show-default-language-url-tag/#post-896123

Let me know if this helps.

Thanks

October 2, 2018 at 10:28 am #2781113

brunoD-31

Hello there,

I've followed these instructions and I managed to fix it. But I also broke something else.

When I type "hidden link" into the browser I get forwarded to:
hidden link
This is the console:
hidden link
As you can see every resource is returning an 404 error

Also when i'm just typing "inesbouwen.com" in the browser (without the http protocol) I'm reffered to this url:
hidden link
This I find super weird since it's putting the /en/ tag twice.

How can I solve this issue?

October 3, 2018 at 5:21 am #2783509

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

This seems unusual, would you mind providing me login details, so I can check the settings once? I need to request temporary access (wp-admin and FTP) to your site in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. hidden link

These info is private, and available to you and supporters only. Read more about this: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Note that:

#1
Backup (both files and database) your site before giving us your credentials. You can use a plugin for this if you like. I often use the Duplicator plugin for this purpose.
See: http://wordpress.org/plugins/duplicator/

Duplicator instruction
hidden link

#2
It would be better if you give me the test site rather than the live site.

#3
If the issues needs some changes in the plugins updates/disabling we will install a plugin called “duplicator” and replicate the site in our local server for testing.

Look forward to your reply.

Thanks

October 3, 2018 at 8:56 am #2783974

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I tried to open:
- comine-capichaca.savviihq.com
- hidden link

and I can see that without any issue it's redirecting to the comine-capichaca.savviihq.com/en/ so could you please check the issue once again on the provided site?

Look forward to your reply.

Thanks

October 3, 2018 at 9:07 am #2783986

brunoD-31

Hello there,

Creating the staging enviroment is an automated process that is provided by our webhost. This might cause it not to happen on the staging environment.

In our office 4 people have tested it, two people don't generate the problem whilest me and someone else have this problem.

We've tried clearing our client cache & we've cleared the server cache.

I could give you the login details to the live website but I can't seem to provide a duplicator package. (See my previous post for screenshots regarding the duplicator issue).
But I can take a backup.

I'll send you the credentials to the live website via a private answer.

EDIT:
I can't seem to create another private ticket, does this have to be initialized by your desk?
For speed purposes I've created the same user on the live website as on the staging site, so you can find the credentials in the ticket above, please login via this url:
hidden link

NOTE:
You have to explicitly go to "hidden link" to generate this problem. Then I am forwarded to a page with alot of 404 statusses:
hidden link

October 3, 2018 at 10:08 am #2784141

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I can see the issue on your live site, could you also provide me FTP details of your site so I can check the lang file once?

I have enabled the private reply for you.

Thanks

October 4, 2018 at 5:23 am #2786438

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Looks like there are some conflicts with the plugin in the live site creating the issue, so could you please perform the below steps and let me know if that helps?

Minimal Setup
If you disable all non-related WPML plugins, switch to one of default themes, the problem persists or not?
NOTE:
+ Make a backup (both files and database) for your site before updating/proceeding anything (Always a good practice!).

Debugging
1. Please follow the debugging information provided here: http://wpml.org/documentation/support/debugging-wpml/
2. Repeat the action of creating the problem.
3. Copy and paste the contents of debug.log (log file inside the /wp-content/ directory) here for me to see.

Look forward to your reply.

Thanks

October 18, 2018 at 10:25 am #2827592

brunoD-31

The problem was with an old caching that belonged to WP Rocket.

The old cache was generated before we added a lang.php file with a redirect to /en/

But the problemed arised when the website was trying to go via the caching hence loading the old cache.