最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - How to stop a permalink redirecting to a page whit same slug but different permalink

programmeradmin3浏览0评论

I have this CPT that has this permalink

/

and this other page

/

And going to / redirects me to / for some weird reason, can anyone help me?

EDIT1: By the way i have "'has_archive' => false," in cpt code in functions.php

EDIT2: As a test i changed the slug for / to / to test what happened and now / does not redirect to nothing but a 404 page, and the cpt page is published and public

I have this CPT that has this permalink

http://example/area-cliente/colecciones/basicos/

and this other page

http://example/basicos/

And going to http://example/area-cliente/colecciones/basicos/ redirects me to http://example/basicos/ for some weird reason, can anyone help me?

EDIT1: By the way i have "'has_archive' => false," in cpt code in functions.php

EDIT2: As a test i changed the slug for http://example/basicos/ to http://example/basicos-2/ to test what happened and now http://example/area-cliente/colecciones/basicos/ does not redirect to nothing but a 404 page, and the cpt page is published and public

Share Improve this question edited Aug 16, 2019 at 7:13 Aitor Rosell Torralba asked Aug 16, 2019 at 6:28 Aitor Rosell TorralbaAitor Rosell Torralba 13 bronze badges 0
Add a comment  | 

2 Answers 2

Reset to default 0

Go to WordPress Settings, and re-save permalinks.

Okay i think i solved it for myself, i still have a problem but is unrelated to this question so i might make a new question for that one.

The problem was that what i had registered as the slug for the CPT was "area-cliente/%category%" when i removed the "/%category%" and added the %category% thing in the permalink menu whit the plugin "Custom Post Type Permalinks" it now works, it solves this question but leaves me whit another problem.

TL;DR: don't put in the slug of a CPT %category% because it appears to not work

发布评论

评论列表(0)

  1. 暂无评论