Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

So we originally have our blog on our main domain (for example, it would be on Now we have moved it to My question is how do we change the address from to

I read this >>> and it said make sure your site is main not a subdomain but I'm trying to move the site to a subdomain. Help.

share|improve this question

migrated from May 24 '11 at 1:47

This question came from our site for professional and enthusiast programmers.

3 Answers 3

Set up HTTP 301 redirects from your old blog URLs to the corresponding URLs on the new site. As soon as Google reindexes your site, they'll see that it has moved and update their index. In the mean time, the 301 redirects will also send any visitors going to your old site to the new location.

For example, to set up a 301 redirect from to using Apache mod_alias, you should add the following line to your Apache config (or in an .htaccess file) for

Redirect 301 /blog

Or you can do the same with mod_rewrite:

RewriteRule ^/?blog(/.*)?$$1 [NS,L,R=301]

If your old blog URLs are so hopelessly mixed with the URLs of your new content on that you can't come up with a reasonable number of regexps to match them, one possible solution is to handle the redirection in your 404 error handler. For some examples, see e.g. this article.

share|improve this answer

www is technically a sub-domain of You would simply change your DNS reference from www to blog (in your A record). If you are keeping the same location and just changing from to, the IP address that the A record points to will be the same. When you change the www sub-domain over to blog, it will start sending traffic to the same location as it used to send your original traffic. Then you just need to be sure that your web server is ready to accept the sub-domain

share|improve this answer

Do you have shared hosting or your own DNS server?

If you want keep the domain for another site you'll need to add either a new sub-domain in your shared hosting control panel for or add a new A record for this sub-domain on your DNS server.

If you want traffic to to auto-redirect to then you could create a CNAME entry instead in your DNS for blog. pointing to www.

You may also have to configure your web server host headers to accept the new sub-domain url as well as your web application if it uses absolute urls.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.