Results 1 to 9 of 9
September 17th, 2008, 12:08 PM #1Question about 301 redirect and moving blog to domain
I have a blog on one of my websites in a subdirectory:
I want to move the entire blog exactly as it is to its own domain:
(Surprise -- those aren't the REAL names. Made 'em up for this example.)
My question concerns doing a 301 redirect. How do I set it up? Do I leave the subdirectory intact on the old mydomain.com? Or do I delete it after I set up the .htaccess redirect? (Does that sound confusing enough? It's because I AM confused about redirects.)
Also, there's a simple looking redirect feature on cpanel. Anybody ever use that? Will it work redirecting a whole subdirectory to a new domain root with a single command?
Any help greatly appreciated!Generate more fake news.
September 17th, 2008, 02:05 PM #2
if your on cpanel just look at the redirects tab and enter the urls in otherwise you need to add the redirects to your htacces.
do you have just the one URL or more pages built into it? for additional pages I don't know if the wildcard redirect will be the one shot fix all or not maybe someone else will have that answer ;-)
add this tyo you'r htacces file at the bottom
RedirectMatch permanent ^/WPs$ http://www.domain.com/WP
if you have not defined your site as www only now might be a good time to consider that depending on how you'r set up (avoiding the google dup gods)
September 17th, 2008, 05:43 PM #3
- Join Date
- April 6th, 2006
Before you setup the redirect.. have you installed on the new domain yet..?
I know there are lots of ways to handle a redirect, but it's my preference to [first] install your blog on the new domain. You can disallow bots to it while you're testing.
This might be stating the obvious, but I once (inadvertantly!) added a redirect before I was finished
Then .. when the new domain is ready (same content, etc).. you setup the 301 redirect from domain.com/blog to newdomain.com. Pagerank from the old will flow to the new... and the old one will cease to exist (ie. no one will be able to access it anymore).
Does WP allow you to copy the site easily, template & all ..? I just did a joomla site & it was a snap..
Alternatively, you don't have to reinstall anything if you want to turn your blog into a subdomain (blog.domain.com), but that's not much different than what you have now.
If you already have the new domain in place (with the blog!), the command is what mrbshouse said.. cpanel just inserts this line (which you can add yourself in .htaccess):
redirect 301 /blog http://www.domainblog.com/
Hope this helps!
September 17th, 2008, 06:09 PM #4
Excellent news. I appreciate the help. Yes, it's fairly straightforward with WP. I'll need to backup the database, then I can search-and-replace within the database to change the URLs of the links.
Fortunately, the blog I'm moving to a domain has only a few dozen pages, posts, etc., unlike another blog I've had for 4 years -- that database is almost 6 megs.Generate more fake news.
September 17th, 2008, 06:48 PM #5
good article about this subject:
article discusses changing hosts, then, near the end, it also discusses moving things to a new domain. this info's right from the horse's mouth. i think it's worth a read.
September 17th, 2008, 07:38 PM #6
Thanks, Donuts, I'll check it out.Generate more fake news.
September 18th, 2008, 07:35 PM #7
Okay, I can't get any 301 redirect for the /blog subdirectory to the http://www.newdomain.com to work?? I tried using the cpanel redirect, and it threw me an Internal Server Error 500 no matter what I tried.
Here's what I'm wondering about:
There's an .htaccess file in the root at the old domain AND there's an .htaccess file in the /blog subdirectory, which is necessary as part of the WP install there to do permalinks and to run a couple of plugins.
The cpanel redirect puts the redirect into the ROOT .htaccess file. If I try putting the command it generates into the /blog subdirectory .htaccess file -- same problem.
Any suggestions? Anyone??
Thanks.Generate more fake news.
September 18th, 2008, 08:00 PM #8
Hooray! I got it. I found a great explanation of how to do this as well as some other blog moving at this URL:
<a href="http://www.bloggingtips.com/2007/04/18/moving-your-blog-to-a-different-directory-domain-name-or-host/">Moving your blog to a different directory, domain name, or host</a>.
That's the best explanation I've found and I've done a lot of googling for it in the last few days.
That discussion made it clear that I needed to put the redirect in the .htaccess file in the actual subdirectory I wanted to redirect, NOT in the root of the domain. And the command I used was this:
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
I hope that code will show up in this post. It was quick and effective.
The blog I was moving had about 50 pages indexed in google, and I certainly didn't want to lose them! LOL!Generate more fake news.
September 18th, 2008, 08:06 PM #9
Ignore my pm. Glad you got it working.Someday starts today
By GoColts in forum Newbie Affiliate FAQs & Helpful ArticlesReplies: 8Last Post: June 30th, 2008, 12:49 PM
By martinsbca in forum WebMerge (Fourthworld.com)Replies: 0Last Post: February 27th, 2007, 04:05 PM
By popdawg in forum Domains & HostingReplies: 3Last Post: September 21st, 2006, 08:50 PM
By ~Michelle in forum Midnight Cafe'Replies: 5Last Post: February 26th, 2006, 08:16 PM
By ~Michelle in forum Search Engine OptimizationReplies: 2Last Post: March 11th, 2005, 11:18 AM