Subdirectories vs subdomains
-
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!
-
Thanks for the responses Yumi, @oznappies & Aaron
-
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.
-
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.
-
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
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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.
Related Questions
-
301 Redirects from example.com to store.example.com and then removing store.example.com subdomain
Hi I'm trying to wrap my head around the best approach for migrating our website. We're migrating from our example.com (joomla) site to our existing store.example.com (shopify) site... with the plan to finish the redirects/migration then remove the subdomain from shopify and use example.com moving forward. I've never done this and asking here to see if any harm will come from re-directing example.com URLs to store.example.com URL's then changing the store.example.com URL's to example.com. Right now my plan would run like this: redirect example.com URL's to store.example.com remove subdomain on store.example.com use example.com moving forward. wonder what happens next? Is there going to be any issues here, possible harm to the URL's?
Technical SEO | | Minarets0 -
Moving E-Commerce Store to Subdomain?
Hi all, We have a customer who currently uses Square for their in-store point-of-sale system as well as for their e-commerce website. From my understanding, a Square site is a watered-down version of Weebly, and is proving to be highly restrictive from an SEO and content structuring standpoint. It's been an uphill battle to try and get traction for their site in SERPs. Would it be a bad idea to move the entire Square online store to a subdomain, and install WordPress on the root domain? This way their online store would remain as-is, but the primary pages on the site would be on WordPress which would give us a lot more control over the content. I just want to make sure this doesn't negatively impact their SEO. Thanks!
Technical SEO | | suarezventures0 -
Personalized Content Vs. Cloaking
Hi Moz Community, I have a question about personalization of content, can we serve personalized content without being penalized for serving different content to robots vs. users? If content starts in the same initial state for all users, including crawlers, is it safe to assume there should be no impact on SEO because personalization will not happen for anyone until there is some interaction? Thanks,
Technical SEO | | znotes0 -
Unknown Subdomains Ranking
In spot checking some pages that I recently launched, I found subdomains ranking in place of the domain. The strange thing is, we never set up these sub-domains and they don't exist on our server. The pages, though they're indexed with the proper title and meta-description, time out when clicked. We're operating on Drupal 7, pages launched at the beginning of the month. The other pages within the series of content are ranking properly. Any thoughts or tips to resolve this?
Technical SEO | | JordanNCU1 -
Easy Question: regarding no index meta tag vs robot.txt
This seems like a dumb question, but I'm not sure what the answer is. I have an ecommerce client who has a couple of subdirectories "gallery" and "blog". Neither directory gets a lot of traffic or really turns into much conversions, so I want to remove the pages so they don't drain my page rank from more important pages. Does this sound like a good idea? I was thinking of either disallowing the folders via robot.txt file or add a "no index" tag or 301redirect or delete them. Can you help me determine which is best. **DEINDEX: **As I understand it, the no index meta tag is going to allow the robots to still crawl the pages, but they won't be indexed. The supposed good news is that it still allows link juice to be passed through. This seems like a bad thing to me because I don't want to waste my link juice passing to these pages. The idea is to keep my page rank from being dilluted on these pages. Kind of similar question, if page rank is finite, does google still treat these pages as part of the site even if it's not indexing them? If I do deindex these pages, I think there are quite a few internal links to these pages. Even those these pages are deindexed, they still exist, so it's not as if the site would return a 404 right? ROBOTS.TXT As I understand it, this will keep the robots from crawling the page, so it won't be indexed and the link juice won't pass. I don't want to waste page rank which links to these pages, so is this a bad option? **301 redirect: **What if I just 301 redirect all these pages back to the homepage? Is this an easy answer? Part of the problem with this solution is that I'm not sure if it's permanent, but even more importantly is that currently 80% of the site is made up of blog and gallery pages and I think it would be strange to have the vast majority of the site 301 redirecting to the home page. What do you think? DELETE PAGES: Maybe I could just delete all the pages. This will keep the pages from taking link juice and will deindex, but I think there's quite a few internal links to these pages. How would you find all the internal links that point to these pages. There's hundreds of them.
Technical SEO | | Santaur0 -
Need Help With WWW vs. Non-WWW Duplicate Pages
A friend I'm working with at RedChairMarket.com is having duplicate page issues. Among them, both www and non-www URLs are being generated automatically by his software framework, ASP.net mvc 3. How should we go about finding and tackling these duplicates? Thanks!
Technical SEO | | BrittanyHighland0 -
Subdomains Issue
Hi , We have created sub domains of our site to target various Geo´s. For example, geo, uk.site.com, de.site,com and all these sub domains have the same content as main domain. Will it affect our SEO Rankings? How can we solve this if it affects our rankings?
Technical SEO | | mikerbrt240 -
How is Google finding our preview subdomains?
I've noticed that Google is able to find, crawl and index preview subdomains we set up for new client sites (e.g. clientpreview.example.com). I know now to use "meta name="robots" and robots.txt) to block the search engines from crawling these subdomains. My question though, is how is Google finding these subdomains? We don't link to these preview domains from anywhere else, so I can't figure out how Google is even getting there. Does anybody have any insight on this?
Technical SEO | | ZeeCreative0