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.

This topic contains 7 replies, has 2 voices.

Last updated by Marcel 1 month, 3 weeks ago.

Assigned support staff: Marcel.

Author Posts
June 12, 2020 at 2:44 pm #6360409

tomB-16

I have a post with a certain slug. In the same language, there is a page with the same slug.
When trying to visit the post (example.com/blog/certain-slug), I get redirected to the page (example.com/certain-slug).

I have a custom permalink structure: /blog/%postname%/

How can I have the post and page with the same slug show correctly?

June 15, 2020 at 9:35 am #6371551

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi,

WPML will allow you to have the same slug for different languages (https://wpml.org/forums/topic/same-slug-across-different-languages/). But you get here into trouble even without WPML.

Example:
Let's say you have a post and a page with the same slug, WordPress will always redirect you first to the page:

Page: hidden link
Post: hidden link

This happens also without WPML. You can solve this with custom redirect rules.

Best Regards
Marcel

June 15, 2020 at 9:40 am #6371579

tomB-16

Hi,

If i disable WPML, there is no problem, because the base is different.

page: hidden link
post: hidden link

Kind regards,
Tom

June 15, 2020 at 10:04 am #6372133

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

My test was based on the same base (without /blog permalink). I would recommend you to use custom redirect rules to solve this.

Best Regards
Marcel

June 15, 2020 at 10:10 am #6372153

tomB-16

Can you please re-try without WPML & custom permalink structure: /blog/%postname%/
/my-test will correctly show the page
/blog/my-test will correctly show the post.
After activating WPML, /blog/my-test gets redirected to /my-test

June 16, 2020 at 4:28 pm #6385655

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi,

thanks for the info. I was able to reproduce it. I will make some further tests and update you ASAP.

Best Regards
Marcel

June 17, 2020 at 9:50 am #6392219

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi,

when WPML is active the /blog/my-test cause a 301 redirect:

>>> <em><u>hidden link</u></em>
> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------
Status:    301 Moved Permanently
Code:    301
Server:    nginx/1.14.0 (Ubuntu)
Date:    Wed, 17 Jun 2020 09:28:58 GMT
Content-Type:    text/html; charset=UTF-8
Connection:    close
X-Redirect-By:    WordPress
Location:    <em><u>hidden link</u></em>

>>> <em><u>hidden link</u></em>

> --------------------------------------------
> 200 OK
> --------------------------------------------

I escalated your case to our devs. I will update you once I receive feedback.

Best Regards
Marcel

June 18, 2020 at 2:14 pm #6404591

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi,

our devs informed me that they are aware of the problem. I escalated your case to the backlog entry, so we can inform you once it gets solved.

Currently, there is sadly no temporary workaround for this issue.

Best Regards
Marcel