WordPress.org

Ready to get started?Download WordPress

Forums

How to redirect permalinks after structure change (6 posts)

  1. Thea
    Member
    Posted 7 months ago #

    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:

    http://yoast.com/change-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?

  2. leejosepho
    Member
    Posted 7 months ago #

    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.

  3. Thea
    Member
    Posted 7 months ago #

    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.

  4. leejosepho
    Member
    Posted 7 months ago #

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

  5. leejosepho
    Member
    Posted 7 months ago #

    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.

  6. Thea
    Member
    Posted 7 months ago #

    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.

Reply

You must log in to post.

About this Topic