WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] moved blog from subdomain to new domain name (4 posts)

  1. acedanger49
    Member
    Posted 8 years ago #

    I moved my blog from blog.domain1.us to http://www.domain2.com. I got wordpress set up correctly and it is functioning 100% on the new domain. How would I set up something (a .htaccess file I'm guessing) to redirect from blog.domain1.us/2006/07/21/some-title to http://www.domain2.com/2006/07/21/some-title?

  2. Jonathan Landrum
    Member
    Posted 8 years ago #

    It would be an .htaccess file, and it would have to be in the old domain's root folder (the subdomain where you were hosting WP before.) Do you still have access to that domain? Here's the syntax:

    Redirect 301 / http://domain2.com/
    Redirect 301 /2006/ http://domain2.com/2006/
    Redirect 301 /2006/07/ http://domain2.com/2006/07/

    etcetera. You don't have to use an absolute URL for the old file location, but you do have to use an absolute URL for the new file location, regardless if it's still in the same root. I changed the permalink structure on my blog a couple months ago and had to do this for every single page on the site. Needless to say, it gets big quickly.

  3. acedanger49
    Member
    Posted 8 years ago #

    Thanks for the reply. I figured this out, using an htaccess file. Below is what I ended up with:

    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^oldURL.com
    RewriteRule ^(.*)$ newURL.com/$1 [r=301]

  4. acedanger49
    Member
    Posted 8 years ago #

    My blog post regarding this is located at here

Topic Closed

This topic has been closed to new replies.

About this Topic