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. Intermediate & Advanced SEO
    4. Blog subdomain not redirecting

    Blog subdomain not redirecting

    Intermediate & Advanced SEO
    25 4 1.2k
    • 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.
    • MarkWill
      MarkWill @AlanMosley last edited by

      Yep, totally agree with the thinking and prefer that approach. I researched the non-www (blank subdomain) solution a while back and the rewrite rule I used was suggested in a number of places. But your suggest seems much more robust, providing there's no gotcha (I know of none).

      I implemented this and it seems to be working (after a bit of a detour because of caching :)). So, I think I am good and will monitor.

      A big thanks to you and Travis. I very much appreciate the prompt responses.

      Mark

      1 Reply Last reply Reply Quote 0
      • Travis_Bailey
        Travis_Bailey @MarkWill last edited by

        I'm hesitant to say; "Do X." because I'm not really sure what will happen - with the redirect plugin in the mix. I imagine a lot, if not all of the subdomain folders and pages have already been redirected via the plugin. So I imagine the path of least disaster at the moment is just redirecting the subdomain (sub.domain.com) to the main domain (www.domain.com) alone.

        I could be totally wrong, but this one is weird.

        Test out the rule and then push live. Here is the code to redirect just the subdomain to just the www domain:

        RewriteCond %{HTTP_HOST} ^blog.domain.com$ [NC]
        RewriteCond %{REQUEST_URI} ^/?$
        RewriteRule .* http://www.domain.com [R=301,L]

        Double check it, triple check it and then push live. Keep a very close eye on it. I really hope we don't end up with a loop.

        AlanMosley Travis_Bailey 2 Replies Last reply Reply Quote 0
        • AlanMosley
          AlanMosley @Travis_Bailey last edited by

          Take a copy of the htaccess file, if something goes wrong, then you can always go back

          1 Reply Last reply Reply Quote 0
          • Travis_Bailey
            Travis_Bailey @Travis_Bailey last edited by

            Looks like that, or some approximation thereof has you sorted. I would just like to add that you should keep an eye on Webmaster Tools.

            MarkWill 1 Reply Last reply Reply Quote 0
            • MarkWill
              MarkWill @Travis_Bailey last edited by

              So far so good - every URL I try to my site is now redirected to the www subdomain and, to date, I am unaware of any side effects. I will keep monitoring but all looks good at this point.

              Thanks again to everyone who helped with this.

              Mark

              1 Reply Last reply Reply Quote 0
              • 1
              • 2
              • 2 / 2
              • First post
                Last post
              • Redirect question | new blog install on subdomain
                R0bin_L0rd
                R0bin_L0rd
                0
                4
                75

              • To redirect or not to redirect, that is the question
                CommT
                CommT
                0
                5
                126

              • Blog On Subdomain - Do backlinks to the blog posts on Subdomain count as links for main site?
                EricaMcGillivray
                EricaMcGillivray
                0
                10
                4.6k

              • 301 Redirect of subdomain?
                FedeEinhorn
                FedeEinhorn
                0
                2
                765

              • Subdomain blog vs. subfolder blog in 2013
                ABK717
                ABK717
                0
                9
                1.8k

              • Redirect posts from a wordpress.com blog over to a self-hosted blog
                blacey
                blacey
                0
                7
                4.5k

              • Subdomains and SEO - Should we redirect to subfolder?
                AndyMacLean
                AndyMacLean
                0
                6
                2.5k

              • Pros and Cons of new subdomain and redirecting old subdomain?
                Lindsay
                Lindsay
                0
                4
                615

              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