Search code examples
wordpresscustom-post-typepermalinkswpml

Postname permalinks not working – all pages send to homepage


I have WordPress installed in a subfolder of my domain. I want to keep it there, so that it is accessible only through http://www.example.com/mywordpress.

I have an issue with permalinks. If I use postname permalinks, all my pages (with different templates applied) redirect to the homepage, while my archives (including custom post type archives and singles) are displaying correctly. If I use custom structure permalinks and I prepend anything to the postname – for example /test/%postname%/ – all pages display correctly while custom post type archives and singles display a 404 error. This happens whenever I refresh permalinks and also after replacing .htaccess with one from a brand new WP install.

The odd thing is also how the permalinks are displaying in the browser url field:

if I use /%postname%/

if I use /test/%postname%/

My custom post types have slugs translated to different languages with WPML. I thought that might cause the issue, however I tried to deactivate all plugins included WPML and still no luck.

Does anyone know what might cause that?


Solution

  • I figured it out. I was using reserved terms as custom taxonomy slugs (https://codex.wordpress.org/Reserved_Terms). By changing them to something else everything started working normally again!