父域与子域
I got involved in a discussion about using subdomains vs subfolders.
我参与了有关使用子域与子文件夹的讨论。
Say I want to create a new section on my website, dedicated to selling honey.
假设我想在我的网站上创建一个新部分,专门销售蜂蜜。
I don’t produce nor sell honey, it’s just an example. Although one of my friends has bees and produces his own honey and it’s delicious
我不生产也不销售蜂蜜,这只是一个例子。 虽然我的一位朋友有蜜蜂并生产自己的蜂蜜,但味道很好
The honey part of the website would be pretty big, with its own application to manage the e-commerce.
该网站的“亲爱的”部分将非常庞大,并拥有自己的应用程序来管理电子商务。
I could add this on my website in two ways. The first is by using a subfolder, like this: flaviocopes.com/honey
.
我可以通过两种方式将其添加到我的网站上。 首先是使用子文件夹,例如: flaviocopes.com/honey
。
The second is by using a subdomain, for example honey.flaviocopes.com
.
第二个是通过使用子域,例如honey.flaviocopes.com
。
There is a third option, which is using its own domain name, like flaviohoney.com
. But let’s focusing on keeping our original domain.
第三种选择是使用自己的域名,例如flaviohoney.com
。 但是,让我们集中精力保留原始域。
A subdomain makes things easier to manage: you have your own completely separate app or CMS or anything, you store it separately in its Git repository if that’s what you use for CI/CD, and you can also host it separately on its own hosting.
子域使事情变得更易于管理:您拥有自己的完全独立的应用程序或CMS或其他任何东西,如果您使用的是CI / CD,则可以将其分别存储在其Git存储库中,并且还可以将其单独托管在其托管服务器上。
I think it’s the ideal solution when you are using an external service like Shopify or anything, as they let you use a subdomain.
我认为当您使用Shopify之类的外部服务时,这是理想的解决方案,因为它们允许您使用子域。
A subfolder on the other hand is a bit more complicated because unless you come up with creative ways on the server side (which implies you need to manage your own server), the code must all be put under the original code that manages the main domain.
另一方面,子文件夹要复杂一些,因为除非您在服务器端提出了创造性的方式(这意味着您需要管理自己的服务器),否则所有代码都必须放在管理主域的原始代码下。
There is a huge advantage, however, that moves the bar toward the subfolder approach: SEO.
但是,有一个巨大的优势,可将标准移至子文件夹方法: SEO 。
Google does not officially confirm it, but it considers subdomains as completely different sites from the main domain.
Google并未正式确认它,但将子域视为与主域完全不同的站点。
honey.flaviocopes.com
would not inherit the SEO “juice” that flaviocopes.com
might have. Having many subdomains will dilute the domain authority over multiple subdomains rather than centralizing it in the main domain.
honey.flaviocopes.com
不会继承flaviocopes.com
可能拥有的SEO“果汁”。 具有多个子域将稀释多个子域上的域权限,而不是将其集中在主域中。
This reason alone could justify using flaviocopes.com/honey
.
仅这个原因就可以证明使用flaviocopes.com/honey
合理的。
From the branding standpoint, I don’t personally think there are differences. It’s much better to have a separate domain, logo and design for a big project. But if it’s just an idea or something you want to test-drive for example, without investing time and effort into having a separate domain, then both subfolder or subdomain approaches will work fine.
从品牌的角度来看,我个人并不认为存在差异。 对于一个大型项目,最好有一个单独的域,徽标和设计。 但是,例如,如果这只是一个想法或您想进行测试的东西,而又不花费时间和精力来建立单独的域,那么子文件夹或子域方法都可以正常工作。
翻译自: https://flaviocopes.com/subfolder-vs-subdomain/
父域与子域