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
-
Canonical vs Alternate for country based subdomain dupe content?
What's the correct method for tagging dupe content between country based subdomains? We have: mydomain.com // default, en-us www.mydomain.com // en-us uk.mydomain.com // uk, en-gb au.mydomain.com // australia, en-au eu.mydomain.com // europe, en-eu In the header of each we currently have rel="alternate" tags but we're still getting dupe content warnings in Moz for the "WWW" subdomain. Question 1) Are we headed in the right direction with using alternate? Or would it be better to use canonical since the languages are technically all English, just different regions. The content is pretty much the same minus currency and localization differences. Question 2) How can we solve the dupe content between WWW and the base domain, since the above isn't working. Thanks so much
Technical SEO | | lvdh11 -
Moving from a subdomain to subfolder
Hello, I am currently working on a site that is leveraging multiple subdomains. I wanted to see if it suggested to migrate them into subfolders. One of the subdomains is a .shop and the other is location specific. Thanks, T
Technical SEO | | Tucker_100 -
301 vs 302
Hello everyone! I'm working with a site right now that is currently formatted as subdomain.domain.net. The old version of the site was formatted as domain.net, with domain.com and several other variants redirecting to the current format, subdomain.domain.net. All of these redirects are 302, and I'm wondering if I should have all these changed to 301. Many of our old backlinks go to the old format of domain.net and i know the juice isn't being passed through, but i was wondering if there is any reason why you may want a 302 over a 301 in this case? Any insight would be appreciated. Thanks!
Technical SEO | | KathleenDC0 -
Anything new if determining how many of a sites pages are in Google's supplemental index vs the main index?
Since site:mysite.com *** -sljktf stopped working to find pages in the supplemental index several years ago has anyone found another way to identify content that has been regulated to the supplemental index?
Technical SEO | | SEMPassion0 -
Redirecting .edu subdomains to our site or taking the link, what's more valuable?
We have a relationship built through a service we offer to universities to be issued a .edu subdomain that we could redirect to our landing page relevant to that school. The other option is having a link from their website to that same page. My first question is, what would be more valuable? Can you pass domain authority by redirecting a subdomain to a subdirectory in my root domain? Or would simply passing the link equity from a page in their root domain to our page pass enough value? My second question is, if creating a subdomain with a redirect is much more valuable, what is the best process for this? Would we simply have their webmaster create the subdomain for us an have them put a 301 redirect to our page? Is this getting in the greyer hat area? Thanks guys!
Technical SEO | | Dom4410 -
Affects of multiple subdomains on homebrew CDN for images
We're creating our own CDN such that instead of serving images from http://mydomain.com/images/shoe.jpg It will appear at all of the following subdomains: http://cdn1.mydomain.com/images/shoe.jpg http://cdn2.mydomain.com/images/shoe.jpg http://cdn3.mydomain.com/images/shoe.jpg http://cdn4.mydomain.com/images/shoe.jpg Image tags on our pages will randomly choose any subdomain for the src. The thought was this will make page loading faster by paralellizing requests across many cookie-less domains. How does this affect : -Ranking of images on Google image search. -Ranking of pages they appear on -Domain authority (images are linked to heavily in our social media efforts, so we will 301 redirect image urls to cdn1.mydomain.com) Should we disallow all but one CDN domain in robots.txt? Will robots.txt on an image only subdomain even be retrieved? Should we just use 1 CDN subdomain instead?
Technical SEO | | cat5com0 -
Www vs non-www
We just had our site redesigned. Previously, it was indexed under www.suss.net, but now the developer has it at suss.net with www.suss.net 301 redirecting to suss.net. Is this bad for SEO?
Technical SEO | | kylesuss0 -
URL Structure "-" vs "/"? Are there any advantages to one over the other?
An example would be domain.com/keyword/keyword2 vs domain.com/keyword-keyword2 Are there any advantages / disadvantages to one over the other?
Technical SEO | | nicole.healthline0