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

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%/
– pages (not working) display as – they all display the homepage contents
– CPT archives+singles (working) display as

if I use /test/%postname%/
– pages (working) display as – so without the prepended text!
– CPT archives+singles (not working) display as – displaying a 404 error

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?

Source link