The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

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

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. How to move my blog from subdomain to subfolder?

    How to move my blog from subdomain to subfolder?

    Technical SEO Issues
    13 7 5.5k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dan-Petrovic
      Dan-Petrovic last edited by

      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 Reply Quote 0
      • Getz.pro
        Getz.pro @Dan-Petrovic last edited by

        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 Reply Quote 1
        • MarloSchneider
          MarloSchneider @Getz.pro last edited by

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

          KeriMorgret MarloSchneider 2 Replies Last reply Reply Quote 0
          • KeriMorgret
            KeriMorgret @MarloSchneider last edited by

            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
            • A_Q
              A_Q @Getz.pro last edited by

              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
              • MarloSchneider
                MarloSchneider @MarloSchneider last edited by

                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
                • jaraca
                  jaraca last edited by

                  This post is deleted!
                  KeriMorgret 1 Reply Last reply Reply Quote -2
                  • KeriMorgret
                    KeriMorgret @jaraca last edited by

                    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
                    • jaraca
                      jaraca last edited by

                      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
                      • Guest
                        Guest last edited by

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • Guest
                          Guest last edited by

                          This post is deleted!
                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post
                          • Subdomain or subfolder?
                            NickSamuel
                            NickSamuel
                            0
                            4
                            1.6k

                          • Moving a subdomain to subfolder with CNAME
                            0
                            1
                            39

                          • Moving from a subdomain to subfolder
                            Vijay-Gaur
                            Vijay-Gaur
                            0
                            3
                            269

                          • I have consolidated my subdomains into subfolders; should i remove the subdomains also?
                            McCaldin
                            McCaldin
                            0
                            5
                            93

                          • To Subdomain or Not Subdomain?
                            AlanMosley
                            AlanMosley
                            0
                            8
                            144

                          • Reverse proxy a successful blog from subdomain to subfolder?
                            joshibhargav_20
                            joshibhargav_20
                            0
                            8
                            3.9k

                          • Subdomain for a blog
                            Francisco_Meza
                            Francisco_Meza
                            0
                            6
                            391

                          • Blog in subfolder or folder
                            SimonCullum
                            SimonCullum
                            0
                            4
                            422

                          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 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                          • Accessibility
                          • Terms of Use
                          • Privacy