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
- 
		
		
		
		
		
		Subdomain 403 error
 Hi Everyone, A crawler from our SEO tool detects a 403 error from a link from our main domain to a a couple of subdomains. However, these subdomains are perfect accessibly. What could be the problem? Is this error caused by the server, the crawlbot or something else? I would love to hear your thoughts. Technical SEO | | WeAreDigital_BE
 Jens0
- 
		
		
		
		
		
		Robots.txt in subfolders and hreflang issues
 A client recently rolled out their UK business to the US. They decided to deploy with 2 WordPress installations: UK site - https://www.clientname.com/uk/ - robots.txt location: UK site - https://www.clientname.com/uk/robots.txt Technical SEO | | lauralou82
 US site - https://www.clientname.com/us/ - robots.txt location: UK site - https://www.clientname.com/us/robots.txt We've had various issues with /us/ pages being indexed in Google UK, and /uk/ pages being indexed in Google US. They have the following hreflang tags across all pages: We changed the x-default page to .com 2 weeks ago (we've tried both /uk/ and /us/ previously). Search Console says there are no hreflang tags at all. Additionally, we have a robots.txt file on each site which has a link to the corresponding sitemap files, but when viewing the robots.txt tester on Search Console, each property shows the robots.txt file for https://www.clientname.com only, even though when you actually navigate to this URL (https://www.clientname.com/robots.txt) you’ll get redirected to either https://www.clientname.com/uk/robots.txt or https://www.clientname.com/us/robots.txt depending on your location. Any suggestions how we can remove UK listings from Google US and vice versa?0
- 
		
		
		
		
		
		Should I use a canonical URL for images uploaded to a blog post in Wordpress?
 Hi, I have a wordpress website that has articles/news posts witch contain imagery. I've noticed that in the Media Library, when you upload an image to a blog post it generates a new permalink ...article-name/article-image-01.jpg I have Yoast SEO plugin and have the option to set a canonical URL for this image. Should I point it back to the actual article? Thanks for any helpers with this. Technical SEO | | Easigrass0
- 
		
		
		
		
		
		Removing site subdomains from Google search
 Hi everyone, I hope you are having a good week? My website has several subdomains that I had shut down some time back and pages on these subdomains are still appearing in the Google search result pages. I want all the URLs from these subdomains to stop appearing in the Google search result pages and I was hoping to see if anyone can help me with this. The subdomains are no longer under my control as I don't have web hosting for these sites (so these subdomain sites just show a default hosting server page). Because of this, I cannot verify these in search console and submit a url/site removal request to Google. In total, there are about 70 pages from these subdomains showing up in Google at the moment and I'm concerned in case these pages have any negative impacts on my SEO. Thanks for taking the time to read my post. Technical SEO | | QuantumWeb620
- 
		
		
		
		
		
		Images, CSS and Javascript on subdomain or external website
 Hi guy's, I came across webshops that put images, CSS and Javascript on different websites or subdomains. Does this boost SEO results? On our Wordpress webshop all the sourcescodes are placed after our own domainname: www.ourdomainname.com/wp-includes/js/jquery/jquery.js?ver=1.11.3' Technical SEO | | Happy-SEO
 www.ourdomainname.com/wp-content/uploads/2015/09/example.jpg Examples of other website: Website 1:
 https://www.zalando.nl/heren-home/ Sourcecode:
 https://secure-i3.ztat.net//camp/03/d5/1a0168ac81f2ffb010803d108221.jpg
 https://secure-media.ztat.net/media/cms/adproduct/ad-product.min.css?_=1447764579000 Website 2:
 https://www.bol.com/nl/index.html Sourcecode:
 https://s.s-bol.com/nl/static/css/main/webselfservice.1358897755.css
 //s.s-bol.com/nl/upload/images/logos/bol-logo-500500.jpg Website 3:
 http://www.wehkamp.nl/ Sourcecode:
 https://static.wehkamp.nl/assets/styles/themes/wehkamp.color.min.css?v=f47bf1
 http://assets.wehkamp.com/i/wehkamp/350-450-layer-SDD-wk51-v3.jpg0
- 
		
		
		
		
		
		"Fourth-level" subdomains. Any negative impact compared with regular "third-level" subdomains?
 Hey moz New client has a site that uses: subdomains ("third-level" stuff like location.business.com) and; "fourth-level" subdomains (location.parent.business.com) Are these fourth-level addresses at risk of being treated differently than the other subdomains? Screaming Frog, for example, doesn't return these fourth-level addresses when doing a crawl for business.com except in the External tab. But maybe I'm just configuring the crawls incorrectly. These addresses rank, but I'm worried that we're losing some link juice along the way. Any thoughts would be appreciated! Technical SEO | | jamesm5i0
- 
		
		
		
		
		
		Subdomain and Domain Rankings
 I have read here that domain names with keywords might add a boost to your search rank For instance using a completely inane example monkey-fights.com might get a boost compared to mfl.com (monkey fighting league) when searching for "monkey fights" There seems to be a hot debate as to how much bonus the first domain might get over the second, but leaving that aside for the moment. Question 1. Would monkey-fights.mfl.com get the same kind of bonus as a root domain bonus? Question 2. If the answer to 1 above was yes would a 301 redirect from the suddomain URL to root domain URL retain that bonus I was just thinking on how hard it is to get root domains these days that are not either being squatted on etc. and if this might be a way to get the same bonus, or maybe subdomains are less bonus prone and so it would be a waste of time Thanks Technical SEO | | bThere0
- 
		
		
		
		
		
		Starting a new product, should we use new domain or subdomain
 I'm working with a company that has a high page rank on it's main domain and is looking to launch a new business / product offering. They are evaluating either creating a subdomain or launching a brand new domain. In either case, their current site will link contextually to the new site. Is there one method that would be better for SEO than the other? The new business / product is related to the main offering, but may appeal to different / new customers. The new business / product does need it's own homepage and will have a different conversion funnel than the existing business. Technical SEO | | gallantc0
 
			
		 
			
		 
			
		 
			
		 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				