Support » Fixing WordPress » How to redirect permalinks after structure change

  • Thea


    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?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Each of my sub-domains has it own registered domain name and its own htaccess file, but yours do not? My thought here is that maybe there is a way to add that if they do not.



    Yes, each of my sub-domains has its own htaccess file, which is why I didn’t expect this problem at all!

    It seems as though the htaccess for the primary domain is taking precedence over the htaccess for the sub-domains.

    Hopefully someone here will know what you can do to fix whatever is going on…

    After reading what AITpro explained to someone else here…
    …I am wondering whether you simply need to add htaccess permalinks code to your sub-domains.



    Thanks, but I’m not sure the posted solution helps me.

    The Yoast code I used was:

    RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$$3

    If I could make the website name ( a wildcard in that expression, so it would redirect within the domain or sub-domain, it would be fine.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to redirect permalinks after structure change’ is closed to new replies.