Skip Navigation

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

Problem:
The client is unable to create a redirect from a URL containing an accented character to a URL without the accent.
Solution:
We recommend encoding the special character in the URL and using a relative path for the old URL. The correct redirect rule in the .htaccess file should look like this:

Redirect 301 /fr/cat%C3%A9gorie/plantes/plantes-dexterieur/ https://mydomain.pt/fr/categorie/plantes/plantes-dexterieur/

If this solution doesn't look relevant, please open a new support ticket.

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

Last updated by Nicolas V. 11 months, 2 weeks ago.

Assisted by: Nicolas V..

Author Posts
January 5, 2024 at 4:17 pm #15155708

ricardoA-22

Hello,

I have a link in french that is mydomain.pt/fr/categorie/plantes/plantes-dexterieur/
some clients, don't know how/why, access mydomain.pt/fr/catégorie/plantes/plantes-dexterieur/ (with accent on "catégorie") and the end blocked by my anti-spam plugin.

Why I can't create a redirect from /fr/catégorie/plantes/plantes-dexterieur/ to /fr/categorie/plantes/plantes-dexterieur/ ?

Can you please help?

January 5, 2024 at 4:28 pm #15155813

Mihai Apetrei
Supporter

Languages: English (English )

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

Hi there.

Before this ticket gets assigned to one of my colleagues, I will try to help.

I recommend that you install this plugin (https://wordpress.org/plugins/redirection/) and set up a 301 redirect.

That should be quick to implement and should start working right away.

Please let us know how things go.

I hope that you will find this information helpful. 🙂

Mihai Apetrei

January 5, 2024 at 4:32 pm #15155841

ricardoA-22

Hi Mihai Apetrei,

Thank you so much for the quick answer.
Since Yoast SEO has that capability I'll avoid at all cost to install a new plugin, hope you understand my point of view.

I need to find a way to have it working with YOAST because it also allows me to create 301 redirects...

January 5, 2024 at 4:34 pm #15155862

Mihai Apetrei
Supporter

Languages: English (English )

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

Hi there.

I can totally understand, this is a super light plugin in my experience but, of course, if you have the premium version of Yoast, they also have this feature and I would definitely not install another plugin for a function I already have from an existing active plugin, just make sure that you have the premium version:
hidden link

Mihai

January 8, 2024 at 8:12 am #15158564

ricardoA-22

I have the premium version of yoast, but that's the problem, it looks like I cannot create any redirection with languages /es/, /fr/, /en/. Why?

January 9, 2024 at 10:43 pm #15166692

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hi Ricardo,

I'm not sure about Yoast redirection capacities but if you don't want to add any extra plugin, you can add those redirects manually into your htaccess.
- Access your server files via FTP or Cpanel
- Open your htaccess file (root level of your WP install)
- After the rewrite rules from WP (after the comment: # END WordPress) you can add your redirections

Here is a quick guide on how to create them: hidden link
It should look like this:

Redirect 301 /fr/old-page/ hidden link;

January 10, 2024 at 8:17 am #15167455

ricardoA-22

On my yoast settings I see that the redirection is being made via php. Can it be the cause?

Captura de ecrã 2024-01-10, às 08.12.50.jpg
January 10, 2024 at 11:32 am #15168433

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hello,

I tried to investigate further the issue. I used "Screaming Frog SEO spider" and scanned your FR site. I couldn't find any broken links to /catégorie (I have the free version which is limited to 500 URLs). So I'm not sure how visitors would land on those URLs. Do you have more information about that? Maybe in Search Console or Google Analytics? I'm trying to find if it's a broken link on your site or maybe an external link from another website.

Now to come back on the redirect, I'm not sure why YOAST won't let you use URL's with /fr.
- Can you write the redirect yourself? Or do you have to pick the page and Yoast creates it for you?
- Why would Yoast prevent URls with /fr? Do you have an error message?

Writing redirections in htaccess is pretty easy and requires no extra plugin.
If you still want to go through Yoast SEO Pro, I think you should contact their support.

On my side I created that sandbox for you: hidden link (auto-login)
You can install Yoast SEO Pro and try to replicate the issue if you want, that way I will be able to test it out myself and understand how their redirection feature works.

January 10, 2024 at 5:04 pm #15170584

ricardoA-22

Hi Nicolas,

Thank you for your reply and analysis of the website.
About the redirects I have to write the url myself (or copy paste the old and new one).

To answer your questions I've recorder a video: hidden link

Now I was able to force the redirection but it has not assumed the accent on the word "catégorie".

January 10, 2024 at 5:07 pm #15170586

ricardoA-22

Update: the accent shows up, i've turned on google translate on my website for the video, that was the cause.

Anyway, fr/catégorie/plantes/plantes-dexterieur is not redirecting to fr/categorie/plantes/plantes-dexterieur, i get a 404.

Thank you

January 11, 2024 at 1:53 pm #15174956

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hi,

I think I know the issue.
1. Google is able to display accents in your browser but this special character should be encoded.
2. The old url should use "relative path" (without the domain name).

I think it should look like this:

Redirect 301 /fr/cat%C3%A9gorie/plantes/plantes-dexterieur/ <em><u>hidden link</u></em>