My main website is on WordPress, then I created another WordPress for Woocommerce on a subdirectory. I did the subdirectory bidding and even changed the rewrite rules for the subdirectory website. the home page opens without issues. But a click to any product page or internal link always results in error 404. If I change the permalinks structure to "Plain" everything will work fine. I can't use the plain permalink structure for a store. Can anyone help me with a solution to fixing this problem?