Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Supporter timezone: Asia/Dhaka (GMT+06:00)

This topic contains 5 replies, has 2 voices.

Last updated by Prosenjit Barman 9 months, 4 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
September 9, 2024 at 5:30 pm #16158233

sylvainP-9

Background of the issue:
In my website, there is a custom post type called school. French is the default language and English is the secondary language. I have set up school post type to - Translatable (use translation if available or fallback to default language). The URL for the single school page is hidden link (English version) and it is working properly.

Symptoms:
If I visit the page as hidden link (French version), it results in a 404 error.

Questions:
How can I fix the 404 error for the French version of the single school page?
Should I use rewrite rules or is there any other solution?

September 10, 2024 at 10:41 am #16160572

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

I understand the issue you're facing. This type of problem typically arises from a conflict with slugs. Specifically, if the same slug is used multiple times across post types, taxonomies, posts, or pages, you may encounter a 404 error when trying to access the item with that slug. Could you please check and make sure that the slug used for the "School" post type has not been used anywhere else?

If not, please add the WPML Debug Information in the next message so that I can get a better overview of the site and system.

- Here's how you can get the Debug Info: https://wpml.org/faq/provide-debug-information-faster-support/

Please add the debug information in the debug information box, located just below your reply box.

Let me know the update. I'll be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

September 10, 2024 at 12:54 pm #16161589

sylvainP-9

Sure, Here I have provided the Debug Info

September 12, 2024 at 4:46 am #16168638

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
I hope you're doing well.

Thank you for providing the debug information. I revisited your site and noticed that particular post is accessible via this link: hidden link

It appears that the slug "creche" is not assigned to any post type, which is why you're encountering a 404 error.

To include this slug in the URL, you'll need to adjust the CPT configuration and add the slug for the default language. For other languages, I'd recommend translating the post type slug following the steps outlined in this link.

I hope you can understand. Feel free to let me know if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit

September 12, 2024 at 2:43 pm #16172126

sylvainP-9

Yes, I got it. But unfortunately we can't do that. Because we have already used slug - school everywhere. If we change it to ecole, it will cause lots of errors throughout the website, even in JavaScript.

So, Is there any other approach that we can try? Please let me know if it is.

Best regards.

September 16, 2024 at 3:42 am #16181151

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
I hope you're doing well. Sorry for the delay in responding due to the weekend.

Thank you for the update. If I use the 'school' slug in French instead of 'creche', there is no problem accessing the post. The post loaded without the 404 error.

If you want to use a different slug for the French version, as I mentioned previously, you'll need to edit the CPT configuration and adjust the slug according to your needs. For example, if you want to have "crèche" in the French language, edit the CPT configuration and add that slug instead of "school". For English and other languages, you can translate the slug by following the instructions mentioned in this guide.

The method I described is the standard approach for defining slugs for the default language and translating them. Unfortunately, beyond that, there is no other approach to translate slug.

However, if you could share more details about your objective and what you're specifically trying to achieve, I can explore other possible solutions and do my best to assist you.

Looking forward to your response and I'm always here to help.

Best regards,
Prosenjit

The topic ‘[Closed] I’m facing a redirection issue in single post pages’ is closed to new replies.