WordPress.org

Ready to get started?Download WordPress

Forums

Old school method of 301 redirecting from subdomain? (3 posts)

  1. clicksharpmarketing
    Member
    Posted 6 years ago #

    I moved my WordPress blog and am having redirect issues.

    The blog used to be on http://blog.domain.com. I want it on http://www.domain.com/blog/.

    So... I moved all the files, and now have confirmed that all my new posts are going in the right place. Problem is, all those backlinks are not redirecting properly.

    I'm not having any luck teaching myself how to deal with this directly via the WordPress dashboard, so I am perfectly happy to create a long-winded entry in .htaccess which will list every single post's old location, followed by its new location. This is not hard to do, just some cut and paste work.

    BUT the changes don't seem to be taking effect. I'm wondering if they have been made in the right place or not. Questions:

    1) Would these redirect entries be made in the core site's .htaccess file, or perhaps in the subdomain where the blog used to reside?
    2) Do I need to unmap the folder which used to be the subdomain, and/or remove the folder all together?
    3) Is there any risk or tradeoff in listing ~100 lines of redirects?

    Thank you all for your wisdom.

  2. mechx1
    Member
    Posted 6 years ago #

    1) No real advantage to putting anything in the old sub-domain, htaccess is processed every time the directory it is in is accessed.
    2) If you moved everything over, it should not affect anything
    3) Sure, there is an additional burden on your server every time you add to .htaccess. It does depend on your host situation. I have seen many more than 100 redirects on a dedicated server with no real issues.

  3. moshu
    Member
    Posted 6 years ago #

    I had an opposite case a while ago. The old address was
    example.com/wp
    and I wanted to move the blog to
    subdomain.example.com/blog
    Since I have preserved the permalink structure it was just one line in the htaccess to redirect every request from the old location to the new location. The htaccess was set up in the root (example.com).
    The line is something like this:
    RewriteRule ^wp/(.*)$ http://subdomain.example.com/blog/$1 [R=301,L]

    Oh, and I got it somewhere here in the forum!

Topic Closed

This topic has been closed to new replies.

About this Topic