Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: Whenever you try to display a translated page, you get a 404 error; the site uses language directories as language URL format

Solution: The issue happens because WordPress doesn't have enabled URL rewrite. If this is the case, you need to edit or create a .htaccess file (see documentation)

Relevant Documentation: https://wpml.org/documentation/getting-started-guide/language-setup/cannot-activate-language-directories/

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

Last updated by bitwociU 3 years, 1 month ago.

Assigned support staff: Laura.

Author Posts
August 10, 2018 at 1:02 pm #2634029

bitwociU

Hi.
I am new to WPML and I have the langue switcher enable and I have translated from the main language "Portuguese" to "Spanish".
Then visiting the default language it works fine, but when I visit the "Spanish" it will show an 404 Not Found error.
Main page URL: hidden link
Translated page URL: hidden link
This must be something really basic that I am missing here, can you please help?
Thank you in advance for your attention.

August 10, 2018 at 1:20 pm #2634059

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi,

are the pages translated?
Can you try to save again the permalinks in Settings -> Permalinks?

August 10, 2018 at 5:43 pm #2635017

bitwociU

Hi Laura,

Yes, I do have translation for that specific page and language.
I also have the permalinks saved for month and name.

Thanks in advance.

Translation.png
August 13, 2018 at 9:26 am #2639263

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi,

actually, the Spanish translation needs to be updated, when it's complete you should get a pencil icon.
May I have your credential so I can take a better look? I'll enable a private reply.

August 13, 2018 at 11:07 am #2639556

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi,

I did some tests but everything seems okay.
What I suggest now:
- backup your site
- go to WPML -> Settings -> "troubleshooting" link
- try all the troubleshooting button (except reset of course)

If they don't work, it's time for a compatibility test:
- backup your site
- disable all plugin except WPML and his addons
- switch to a default theme like TwentySeventeen
- check if the issue is happening again
- if it's not, reactivate your plugins one by one, checking every time if the issue shows up again
- lastly, reactivate your theme

Let me know the results of these tests.

August 13, 2018 at 1:37 pm #2640063

bitwociU

Hi Laura,

Unfortunately the issue still maintains. I have updated the WordPress language to English for your convenience.
This is still an under construction website, I just did a backup so please feel free to experiment risky options and if you need me to restore it, please let me know.

Thanks in advance

August 14, 2018 at 7:33 am #2642504

Laura
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi,

the problem seems to be with language directories that do not work. Probably you need to rewrite your .htaccess
Please try what is suggested here: https://wpml.org/documentation/getting-started-guide/language-setup/cannot-activate-language-directories/
and let me know if it works or if we need to debug further.

August 20, 2018 at 8:41 am #2658654

bitwociU

Dear Laura,

It worked following your instructions.
Edited the .htaccess to have:

# BEGIN WPML
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WPML

Thank you so much for your kind help.
Best Regards.