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. Subdirectories vs subdomains

    Subdirectories vs subdomains

    Technical SEO Issues
    5 4 797
    • 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.
    • hectorpn
      hectorpn last edited by

      Hi SEO gurus   🙂

      Anyone has input on what's better?

      blog.domain.com vs domain.com/blog

      store.domain.com vs domain.com/store

      etc

      I think the subdir (/xyz) will concentrate authority on the same subdomain so should be better? However sometimes it is tidier on the server to maintain online stores or blogs in a separate strucutre so subdomains work better in that sense. I just want to make sure that doesn't affect SEO?

      Cheers!

      1 Reply Last reply Reply Quote 0
      • IKT
        IKT last edited by

        in my opinion? definitely subdirectory. and in fact it will still be tidier on the server maintainability ..

        For example please consider the following setup

        you have your MYDOMAIN.com located at /var/www/html-mydomain

        and by using a SUBDOMAIN.MYDOMAIN.COM, you will generally have them at /var/www/html-subdomain-mydomain

        it looks tidier as you said it BUT you can achieve exactly the same thing using MOD_REWRITE

        so perhaps right now your MYDOMAIN.com/SUB is located at /var/www/html-mydomain/SUB right? you can actually write a .htaccess that whenever user is going to MYDOMAIN.com/SUB it actually load the page under /var/www/html-subdomain-mydomain instead ! (so the server maintainability between using the subdirectory and subdomain will be exactly the same)

        a much more technical example , put this inside your .htaccess of your root domain home directory

        RewriteCond %{HTTP_HOST}   ^[www\.]*sub-domain-name.domain-name.com [NC]
        RewriteCond %{REQUEST_URI} !^/sub-domain-directory/.*
        RewriteRule   ^(.*)  /sub-domain-directory/$1  [L]
        

        This will cause the following situation

        when people go to http://sub-domain-name.domain-name.com/a.html AND http://domain-name.com/sub-domain-directory/a.html

        both of them will open your /sub-domain-directory/a.html instead

        hope this help

        1 Reply Last reply Reply Quote 2
        • oznappies
          oznappies last edited by

          I've asked this one on here before and have some test sites trialling both ways and the sub-directory gains rank much faster from the root than the sub-domain.

          1 Reply Last reply Reply Quote 0
          • AaronSchinke
            AaronSchinke last edited by

            Sub directories/folders used to be the definite way to go for the most SEO value however things have evened out for the most part. I think sub directories are more user friendly... we are used to the slash... extra periods can get tricky.

            1 Reply Last reply Reply Quote 0
            • hectorpn
              hectorpn last edited by

              Thanks for the responses Yumi, @oznappies & Aaron

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • vs.
                NickJasuja
                NickJasuja
                0
                4
                3.5k

              • Does using a reverse proxy to make a subdomain appear as a subdirectory affect SEO?
                joshibhargav_20
                joshibhargav_20
                1
                5
                1.0k

              • 404 vs 410 vs 301
                LoonyToons
                LoonyToons
                0
                4
                1.8k

              • Subdomains or Subdirectory for multisite SEO structure?
                DirkC
                DirkC
                1
                3
                224

              • Different domains vs subdomains for 6 e-shops
                TauriUrb
                TauriUrb
                0
                5
                371

              • Subdomain vs Main Domain Penalties
                Prospector-Plastics
                Prospector-Plastics
                0
                10
                4.9k

              • Root directory vs. subdirectories
                Cyrus-Shepard
                Cyrus-Shepard
                0
                4
                2.6k

              • Rankings of Subdomains vs. Main Domain
                JarnoNijzing
                JarnoNijzing
                0
                4
                1.0k

              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