Skip Navigation

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

Problem: Translated 404 page does not show up on requests to non-existent URLs in secondary language.

Solution: Translate custom URL setting for the 404 to 301 - Redirect plugin.

Relevant Documentation:

  • In the WordPress dashboard, go to WPML → String Translation
  • In the "Select strings within domain:" drop-down, find admin_texts_i4t3_gnrl_options (or the relevant domain for the plugin being used for redirection), click Search
  • There should be a result similar to [i4t3_gnrl_options]redirect_link - or the relevant result containing the URL in the original language
  • Click on its Translations and insert the URL of the 404 page in secondary language
  • To get the URL, in WordPress admin dashboard go to Pages, click on the secondary language name above the pages list to show only pages in that language, find the 404 page, mouse over it and click "View", then copy the URL from the browser bar
  • Check the Translation is complete box, Save
  • Try going to a non-existent URL in secondary language, like https://www.your-domain.com/%5Bsecondary-language-code%5D/something/ - you should see the secondary language 404 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 5 replies, has 2 voices.

Last updated by thomasW-84 3 months, 4 weeks ago.

Assigned support staff: Max Kovalenkov.

Author Posts
July 31, 2020 at 8:49 am #6713579

thomasW-84

Hello,

The language switcher in the top navigation menu of my website does not work.
Carlos from your team has found out, that this issue is related to the 404-redirect plugin I'm using.

I've tried the plugins for the 404 redirect which were recommended by WPML:
404page and 404to301 redirect.
With 404page the language switcher always gets a (real) 404 error. With 404to301 the language switcher links to the current page instead of the translated one.

Carlos asked me to create a separate ticked for this for your 2nd level support.

I got 2 languages on my website: English (original) and German (translations). With the 4040 plugin I'd like to be able to link to a custom 404 page. This page is available in two languages, too. So if the 404 happens on a English page, the plugin should forward to the English 404 page. If the the 404 happens with a German page, the plugin should forward to the German 404 page.

My setup:
- Theme: TheGem
- Website not live, Coming soon plugin active
- URL: <a href="hidden link />- Languages: Original = English, Translation = German
- Login credentials: are added below in your ticket interface
- WPML Setup (plugins, php, wordpress version): See screenshot 00-wpml-settings

Could you please help me with this?
It's probably better to handle this as a ticket instead of within the chat.

Thomas

July 31, 2020 at 7:03 pm #6717367

Max Kovalenkov
Supporter

Languages: English (English ) French (Français ) Russian (Русский ) Portuguese (Brazil) (Português )

Timezone: America/Toronto (GMT-05:00)

Hello Thomas,

Thank you for creating a new ticket for this issue!

Could you share a screenshot with the settings for 404 to 301 Redirect plugin, similar to this:

hidden link

Perhaps it's the "Custom URL" setting that needs to be made translatable.

I will also share test server information in my next private reply momentarily.

August 1, 2020 at 8:55 am #6718627

thomasW-84

Hi Max,

Thanks for looking into this.
Here is the screenshot you were looking for. It's a match to the screenshot you've provided before.

I'll look in to the cloud server migration today in the afternoon.

Thomas

August 1, 2020 at 9:35 am #6718685

thomasW-84

Hi Max,

Migration with Cloudways has completed.

Thomas

August 1, 2020 at 7:24 pm #6719899

Max Kovalenkov
Supporter

Languages: English (English ) French (Français ) Russian (Русский ) Portuguese (Brazil) (Português )

Timezone: America/Toronto (GMT-05:00)

Hello Thomas,

Thank you so much for getting the test site migrated.

As I suspected, the plugin works - just needs its custom URL setting "translated". Right now it knows where to redirect in case of a 404 in English, but not in German.

Here are the steps:

  • In the WordPress dashboard, go to WPML → String Translation
  • In the "Select strings within domain:" drop-down, find admin_texts_i4t3_gnrl_options, click Search
  • There should be 1 result: [i4t3_gnrl_options]redirect_link (see screenshot)
  • Click on Translations and insert the URL of your 404 page in German
  • To get the URL, in WordPress admin dashboard go to Pages, click on "German" filter above the list, find the 404 page, mouse over it and click "View", then copy the URL from the browser bar
  • Check the Translation is complete box, Save
  • Try going to a non-existent URL in German, like hidden link - should see the German 404 page
August 3, 2020 at 7:04 pm #6728361

thomasW-84

Everything clear, bug fixed, very professional and nice support.