Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
How to move my blog from subdomain to subfolder?
- 
					
					
					
					
 Not an unusual situation, I have a blog on blog.domain.com it has quite a few blog postings. The platform is old and will be scrapped, but the blog content itself is going to be moved to domain.com/blog. The current process is we are manually listing all linked to/content pages and we are going to 301 redirect them to their counterparts on the new blog. This is going to be a tedious process. A) Is there any way to automate the moving of the blog? B) What is the best way to do the massive 301 redirect, php headers, .htaccess? Should we move the individual pages with redirects, or redirect the domain in the .htaccess (this will be very difficult to match all the titles and file structure)? 
- 
					
					
					
					
 Hi Keri. You're right! I am not a professional in the matter and I am trying to catch up little by little. Thanks for your advice! 
- 
					
					
					
					
 This thread is actually four years old, and the original poster mentioned that the problem was solved so no worries! You might want to look at more recent questions, as SEO advice can change as the search engines change. 
- 
					
					
					
					
 We solved it, our web programmer wrote a program to scrape all of our posts and turn them into a format that imported into wordpress. As far as the redirects we kept the page titles the same and did a sitewide 301 that sent them from blog.example.com to example.com/blog/ Although I would still like to grab Richard's php script for doing this in a more efficient manner in the future. 
- 
					
					
					
					
 It will if you add r=301 to the last line like so: RewriteRule ^(.*)$ /blog/$1 [L,R=301] 
- 
					
					
					
					
 Spencer, did you get this taken care of off-line, or is this question still open? [Keri Morgret, SEOmoz Associate] 
- 
					
					
					
					
 Would you mind posting or messaging me the correct script? It would be a great help, thanks. 
- 
					
					
					
					
 Yup, that will do the job of relocation, but it does not 301 the link and therefore you will not transfer link juice. 
- 
					
					
					
					
 Found this one: RewriteEngine On 
 RewriteCond %{HTTP_HOST} ^blog.mysite.com
 RewriteRule ^(.*)$ /blog/$1 [L]
- 
					
					
					
					
 I am mobile, so excuse the typos  Using PHP, grab the incoming title and do a 301 header redirect to the new location. No need to mass 301 in .htaccess. Using PHP, grab the incoming title and do a 301 header redirect to the new location. No need to mass 301 in .htaccess. If you need the script, let me know If you need the script, let me know
Browse Questions
Explore more categories
- 
		
		Moz ToolsChat with the community about the Moz tools. 
- 
		
		SEO TacticsDiscuss the SEO process with fellow marketers 
- 
		
		CommunityDiscuss industry events, jobs, and news! 
- 
		
		Digital MarketingChat about tactics outside of SEO 
- 
		
		Research & TrendsDive into research and trends in the search industry. 
- 
		
		SupportConnect on product support and feature requests. 
Related Questions
- 
		
		
		
		
		
		Moving E-Commerce Store to Subdomain?
 Hi all, We have a customer who currently uses Square for their in-store point-of-sale system as well as for their e-commerce website. From my understanding, a Square site is a watered-down version of Weebly, and is proving to be highly restrictive from an SEO and content structuring standpoint. It's been an uphill battle to try and get traction for their site in SERPs. Would it be a bad idea to move the entire Square online store to a subdomain, and install WordPress on the root domain? This way their online store would remain as-is, but the primary pages on the site would be on WordPress which would give us a lot more control over the content. I just want to make sure this doesn't negatively impact their SEO. Thanks! Technical SEO | | suarezventures0
- 
		
		
		
		
		
		Is having my homepage on a subfolder harmful?
 Hi guys, I am the webmaster of the following two websites: www.gpblog.com/nl Technical SEO | | NielsDE
 www.gpblog.com/en The first URL is the Dutch version of GPBlog, the second URL is the UK version of GPblog. Whenever a person visits www.gpblog.com he gets redirected to either the Dutch version or the UK version based on his location. My question is: is it harmful to have 1. your homepage on a subfolder and 2. is it harmful to run two different languages on one domain using this technique? Thank you in advance!1
- 
		
		
		
		
		
		Does a subdomain benefit from being on a high authority domain?
 I think the title sums up the question, but does a new subdomain get any ranking benefits from being on a pre-existing high authority domain. Or does the new subdomain have to fend for itself in the SERPs? Technical SEO | | RG_SEO0
- 
		
		
		
		
		
		Reverse proxy a successful blog from subdomain to subfolder?
 I have an ecommerce site that we'll call confusedseo.com. I created a WordPress blog and CNAME'd it to blog.confusedseo.com. Since then, the blog has earned a PageRank of 3 and a decent amount of organic traffic. I am considering a reverse proxy to forward blog.confusedseo.com to confusedseo.com/blog/. As I understand it, this will greatly help the "link juice" of the root domain. However, I'm concerned about any potential harm done to the existing SEO value of the blog. What, if anything, should I be doing to ensure that the reverse proxy doesn't hurt my "juice" rather than help it? Technical SEO | | bedbugsupply0
- 
		
		
		
		
		
		Subdomain vs Main Domain Penalties
 We have a client who's main root.com domain is currently penalized by Google, but the subdomain.root.com is appearing very well. We're stumped - any ideas why? Technical SEO | | Prospector-Plastics0
- 
		
		
		
		
		
		Best Way To Clean Up Unruly SubDomain?
 Hi, I have several subdomains that present no real SEO value, but are being indexed. They don't earn any backlinks either. What's the best way of cleaning them up? I was thinking the following: 1. Verify them all in Webmaster Tools. 2. Remove all URLs from the index via the Removal Tool in WMT 3. Add site-wide no-index, follow directive. Also, to remove the URLs in WMT, you usually have to block the URLs via /robots.txt. If I'd like to keep Google crawling through the subdomains and remove their URLs, is there a way to do so? Technical SEO | | RocketZando0
- 
		
		
		
		
		
		Internal vs external blog and best way to set up
 I have a client that has two domians registered - one uses www.keywordaustralia.com the other uses www.keywordaelaide.com He had already bought and used the first domain when he came to me I suggested the second as being worth buying as going for a more local keyword would be more appropriate. Now I have suggested to him that a blog would be a worthy use of the second domain and a way to build links to his site - however I am reading that as all links will be from the same site it wont be worth much in the long run and an internal blog is better as it means updated content on his site. should i use the second domain for blog, or just 301 the second domain to his first domain. Or is it viable to use the second domain as the blog and just set up an rss feed on his page ? Is there a way to have the second domain somehow 'linked' to his first domain with the blog so that google sees them as connected ? NOOBIE o_0 Technical SEO | | mamacassi0
- 
		
		
		
		
		
		Microsite on subdomain vs. subdirectory
 Based on this post from 2009, it's recommended in most situations to set up a microsite as a subdirectory as opposed to a subdomain. http://www.seomoz.org/blog/understanding-root-domains-subdomains-vs-subfolders-microsites. The primary argument seems to be that the search engines view the subdomain as a separate entity from the domain and therefore, the subdomain doesn't benefit from any of the trust rank, quality scores, etc. Rand made a comment that seemed like the subdomain could SOMETIMES inherit some of these factors, but didn't expound on those instances. What determines whether the search engine will view your subdomain hosted microsite as part of the main domain vs. a completely separate site? I read it has to do with the interlinking between the two. Technical SEO | | ryanwats0
 
			
		 
			
		 
			
		 
			
		 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				