undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • MozCon
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Digital Marketers
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    Let your business shine with Listings AI
    Moz Local

    Let your business shine with Listings AI

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Digital Marketers

      Simplify SEO tasks to save time and grow your traffic.

    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

Browse the forum for helpful insights and fresh discussions about all things SEO.

  1. Home
  2. SEO Tactics
  3. Technical SEO
  4. How to move my blog from subdomain to subfolder?

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?

Technical SEO
7
10
7.8k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • MarloSchneider
    MarloSchneider last edited by Feb 23, 2011, 11:35 PM

    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)?

    1 Reply Last reply Reply Quote 0
    • jaraca
      jaraca last edited by Jun 16, 2015, 8:07 PM Jun 16, 2015, 8:07 PM

      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!

      1 Reply Last reply Reply Quote 0
      • KeriMorgret
        KeriMorgret last edited by Jun 16, 2015, 8:01 PM Jun 16, 2015, 8:01 PM

        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.

        1 Reply Last reply Reply Quote 0
        • topic:timeago_earlier,4 years
        • MarloSchneider
          MarloSchneider @MarloSchneider last edited by May 11, 2011, 5:43 PM May 11, 2011, 5:43 PM

          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.

          1 Reply Last reply Reply Quote 0
          • topic:timeago_earlier,7 days
          • A_Q
            A_Q @Getz.pro last edited by May 4, 2011, 1:25 PM May 4, 2011, 1:25 PM

            It will if you add r=301 to the last line like so:

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

            1 Reply Last reply Reply Quote 0
            • KeriMorgret
              KeriMorgret @MarloSchneider last edited by May 1, 2011, 10:26 PM May 1, 2011, 10:26 PM

              Spencer, did you get this taken care of off-line, or is this question still open?

              [Keri Morgret, SEOmoz Associate]

              1 Reply Last reply Reply Quote 0
              • topic:timeago_earlier,2 months
              • MarloSchneider
                MarloSchneider @Getz.pro last edited by Feb 24, 2011, 3:48 PM Feb 24, 2011, 3:48 PM

                Would you mind posting or messaging me the correct script?  It would be a great help, thanks.

                KeriMorgret MarloSchneider 2 Replies Last reply May 11, 2011, 5:43 PM Reply Quote 0
                • Getz.pro
                  Getz.pro @Dan-Petrovic last edited by Feb 24, 2011, 10:22 AM Feb 24, 2011, 10:22 AM

                  Yup, that will do the job of relocation, but it does not 301 the link and therefore you will not transfer link juice.

                  A_Q 1 Reply Last reply May 4, 2011, 1:25 PM Reply Quote 1
                  • Dan-Petrovic
                    Dan-Petrovic last edited by Feb 24, 2011, 3:16 AM Feb 24, 2011, 3:16 AM

                    Found this one:

                    RewriteEngine On
                    RewriteCond %{HTTP_HOST} ^blog.mysite.com
                    RewriteRule ^(.*)$ /blog/$1 [L]

                    Source: http://www.scriptygoddess.com/archives/2007/06/13/redirect-a-subdomain-to-a-directory-using-htaccess/

                    Getz.pro 1 Reply Last reply Feb 24, 2011, 10:22 AM Reply Quote 0
                    • Getz.pro
                      Getz.pro last edited by Feb 24, 2011, 12:34 AM Feb 24, 2011, 12:34 AM

                      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. 🙂 If you need the script, let me know

                      MarloSchneider 1 Reply Last reply Feb 24, 2011, 3:48 PM Reply Quote 0
                      • 1 / 1
                      1 out of 10
                      • First post
                        1/10
                        Last post

                      Got a burning SEO question?

                      Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                      Start my free trial


                      Browse Questions

                      Explore more categories

                      • Moz Tools

                        Chat with the community about the Moz tools.

                      • SEO Tactics

                        Discuss the SEO process with fellow marketers

                      • Community

                        Discuss industry events, jobs, and news!

                      • Digital Marketing

                        Chat about tactics outside of SEO

                      • Research & Trends

                        Dive into research and trends in the search industry.

                      • Support

                        Connect on product support and feature requests.

                      • See all categories

                      Related Questions

                      • lauralou82

                        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
                        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?

                        Technical SEO | Apr 26, 2018, 1:35 PM | lauralou82
                        0
                      • arun.negi

                        We switched the domain from www.blog.domain.com to domain.com/blog.

                        We switched the domain from www.blog.domain.com to domain.com/blog. This was done with the purpose of gaining backlinks to our main website as well along with to our blog. This set us very low in organic traffic and not to mention, lost the backlinks. For anything, they are being redirected to 301 code. Kindly suggest changes to bring back all the traffic.

                        Technical SEO | Nov 12, 2017, 10:15 AM | arun.negi
                        0
                      • Cocoonfxmedia

                        Referencing links in Articles and Blogs

                        Hi I am wondering if the <sup>tag in html is picked up by google as a reference point?</sup> I.e when you put a superscript in word it puts a small number next to your sentence. Then you have a list of reference at the end of the blog/article does google recognise this?

                        Technical SEO | Jun 21, 2015, 7:22 AM | Cocoonfxmedia
                        0
                      • Rignite

                        Should I noindex my blog's tag, category, and author pages

                        Hi there, Is it a good idea to no index tag, category, and author pages on blogs? The tag pages sometimes have duplicate content.  And the category and author pages aren't really optimized for any search term. Just curious what others think. Thanks!

                        Technical SEO | Oct 10, 2014, 4:53 AM | Rignite
                        0
                      • Creditsafe

                        No index on subdomains

                        Hi, We have a subdomain that is appearing in the search results - I want to hide this as it looks really bad. If I were to add the no index tag to the sub domain would URL would this affect the whole domain or just that sub domain? The main domain is vitally important - it is just that sub domain I need to hide. Many thanks

                        Technical SEO | Mar 14, 2014, 12:53 AM | Creditsafe
                        0
                      • Gordian

                        Speed benefits from loading images from a subdomain

                        I have read that loading images from a subdomain of your site instead of the main domain will give you speed benefits on load time. Has anyone actually seen that to be the case? Thanks!

                        Technical SEO | Jul 15, 2013, 12:10 PM | Gordian
                        0
                      • rahulchowdhury

                        Unnecessary pages getting indexed in Google for my blog

                        I have a blog dapazze.com and I am suffering from a problem for a long time. I found out that Google have indexed hundreds of replytocom links and images attachment pages for my blog. I had to remove these pages manually using the URL removal tool. I had used "Disallow: ?replytocom" in my robots.txt, but Google disobeyed it. After that, I removed the parameter from my blog completely using the SEO by Yoast plugin. But now I see that Google has again started indexing these links even after they are not present in my blog (I use #comment). Google have also indexed many of my admin and plugin pages, whereas they are disallowed in my robots.txt file. Have a look at my robots.txt file here: http://dapazze.com/robots.txt Please help me out to solve this problem permanently?

                        Technical SEO | Mar 13, 2013, 3:49 AM | rahulchowdhury
                        0
                      • SCFederal

                        Keep the blog separate or incorporate into main domain?

                        So my organization currently has both a main site and on a separate domain and separate host a wordpress blog.  (our own domain not a wordpress.com) the content posted on this blog is local, community driven, and related to our business but it is not used in anyway as a "sales" tool.  It's more for interaction purposes with members and employees. This blog has a lot of content and is updated with new posts very often. (generate traffic from a pretty wide variety of searches some related some not)  My plan has been to 301 the old domain and move the wordpress blog over to our root domain in a subdirectory such as oursite.com/blog. Does anyone have tips for moving a blog over like this?  I'm concerned about any link juice it has dropping off and since it does provide some links to our root site currently (since it's basically a separate site).  Basically i'm wondering if it'll be worth the effort or if i should just keep it separate and focus on other content gen strategies.

                        Technical SEO | Jun 20, 2012, 3:33 PM | SCFederal
                        0

                      Get started with Moz Pro!

                      Unlock the power of advanced SEO tools and data-driven insights.

                      Start my free trial
                      Products
                      • Moz Pro
                      • Moz Local
                      • Moz API
                      • Moz Data
                      • STAT
                      • Product Updates
                      Moz Solutions
                      • SMB Solutions
                      • Agency Solutions
                      • Enterprise Solutions
                      • Digital Marketers
                      Free SEO Tools
                      • Domain Authority Checker
                      • Link Explorer
                      • Keyword Explorer
                      • Competitive Research
                      • Brand Authority Checker
                      • Local Citation Checker
                      • MozBar Extension
                      • MozCast
                      Resources
                      • Blog
                      • SEO Learning Center
                      • Help Hub
                      • Beginner's Guide to SEO
                      • How-to Guides
                      • Moz Academy
                      • API Docs
                      About Moz
                      • About
                      • Team
                      • Careers
                      • Contact
                      Why Moz
                      • Case Studies
                      • Testimonials
                      Get Involved
                      • Become an Affiliate
                      • MozCon
                      • Webinars
                      • Practical Marketer Series
                      • MozPod
                      Connect with us

                      Contact the Help team

                      Join our newsletter
                      Moz logo
                      © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                      • Accessibility
                      • Terms of Use
                      • Privacy

                      Looks like your connection to Moz was lost, please wait while we try to reconnect.