I’ve changed my domain to a directory and I need to redirect my permalinks.
This method from Yoast seemed to work perfectly, pasted into my .htaccess file:
How to change your WordPress permalink structure
But then I realized a HUGE snag: I have sub-domains which don’t need this redirect, and the code is applying to them too, resulting in a pile of 404 errors.
How can I modify this code so it applies to the main domain only?