WordPress.org

Support

Support » How-To and Troubleshooting » How to redirect permalinks after structure change

How to redirect permalinks after structure change

  • Thea

    @dorothy1508

    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)
  • leejosepho

    @leejosepho

    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.

    Thea

    @dorothy1508

    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.

    leejosepho

    @leejosepho

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

    leejosepho

    @leejosepho

    After reading what AITpro explained to someone else here…
    http://wordpress.org/support/topic/bps-causes-my-html-sites-to-show-forbiddn?replies=4
    …I am wondering whether you simply need to add htaccess permalinks code to your sub-domains.

    Thea

    @dorothy1508

    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})/(.*)$ http://bellydanceoz.com/$3

    If I could make the website name (http://bellydanceoz.com) 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.