子域好还是子文件夹好?

发布于 2024-07-25 06:51:43 字数 210 浏览 4 评论 0原文

我有一个分类网站,我想知道创建子域或子文件夹是否更好,因为我处于混乱状态。

如果我们需要使用子域名,那么我们可以从子域名中获得什么好处?

如果我们需要获取子文件夹,那么我们可以从中获得什么好处?

如果我们创建子域,那么 Google 会将子域视为单独的域,并且每页仅显示 2 个结果。

所以请消除我的疑虑并让我知道哪一个更好。

I have a classifieds site and I want to know whether creating subdomains or sub-folders is better, as I am in state of confusion.

If we need to take sub-domains then what are the benefits which we can get from sub-domains?

If we need to take sub-folders then what are the benefits we can get from them?

If we create sub-domains then Google considers sub-domains as individual domains and would show only 2 results per page.

So please clear my doubts and let me know which one is better.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

南烟 2024-08-01 06:51:43

搜索引擎会将子域视为单独的域,因此在许多情况下使用子文件夹是可行的方法,这样您就不会分散自己。

使用两者并不是一个好主意,因为搜索引擎会尝试对两者进行索引,其中一个会被标记为重复内容。

这是 SEOMoz 的一篇文章,更详细地解释了这一点:
http://www.seomoz.org/blog/understanding -根域-子域-vs-子文件夹-微型站点

Search engines will treat subdomains more like separate domains, so it many cases using sub-folders is the way to go, so that you are not spreading yourself to thin.

using both is a bad idea, as search engines will try to index both, and one will get flagged as duplicate content.

Here's an article from SEOMoz explaining it in more detail:
http://www.seomoz.org/blog/understanding-root-domains-subdomains-vs-subfolders-microsites

歌入人心 2024-08-01 06:51:43

就我个人而言,我认为子域是同一家公司拥有的不同应用程序/站点的逻辑。 子文件夹是同一应用程序/站点的一部分。

如果您拥有“一个大站点”,而不是许多不同的松散耦合域,那么对于您的 PageRank/搜索引擎列表可能会更好。 如果站点的内容明显不同,例如个人站点可能有一个画廊或博客子域,它使内容与主站点明显分开 - 那么它对于子域可能是有意义的,否则,我会坚持使用文件夹。

ps 旁注,不知道这是否重要,但网络浏览器在下载构成页面的不同文件时仅一次打开两个到网站的连接。 因此,在这种情况下,子域有一个原因,它可以主动加快(尽管在快速站点上,至少)页面加载时间。

Personally, I go off the logic that a subdomain is a different application / site owned by the same company. A subfolder is part of the same application / site.

It is probably better for your PageRank / search engine listings if you have 'one-big-site', rather than lots of different loosely coupled domains. If the content of the sites is distinctly different, e.g. a personal site might have a gallery or blog subdomain which keeps the content distinctly seperate from the main site - then it probably makes sense for a subdomain, otherwise, I'd stick with folders.

p.s. Side note, dunno if this is important, but web-browsers only open two connections at once to a website when downloading the different files that constitute a page. So there is a reason for a subdomain in this instance where it actively speeds up (though, on a fast site, minimally) the page load time.

鸠书 2024-08-01 06:51:43

这取决于您要为其创建子文件夹/域的内容。

与您原来的网站相关吗? 那么您绝对应该使用子文件夹,因为它属于同一域。 如果您使用子文件夹,则链接效果会更好地传播。

至于PageRank,最好使用子文件夹。

子域被视为新站点。 子文件夹则不然,如果您的原始网站功能强大,子文件夹将会获得更好的排名。

如果您愿意,您可以使用子域和子文件夹,但不要忘记使用规范标签以避免重复内容。

两个相关链接进一步解释了这一点:

http://www.searchmarketingstandard。 com/何时使用子域与子文件夹
http://www.searchenginejournal.com /子域名或子文件夹对于 seo 来说更好/6849/

It depends on what content you want to create subfolder/-domains for.

Is it related to your original site? Then you should definitely use sub-folder as this belongs to the same domain. It's much better for the link juice to spread if you use sub folders.

As for the PageRank, it's better to use subfolders.

Subdomains is considered as a new site. Subfolders is not, and will get better rankings if your original site is powerful.

You can use both subdomains and subfolders if you like, but don't forget to use the canonical-tag to avoid duplicate content.

Two relevant links that explains this further:

http://www.searchmarketingstandard.com/when-to-use-subdomains-vs-subfolders
http://www.searchenginejournal.com/subdomains-or-subfolders-which-are-better-for-seo/6849/

笑红尘 2024-08-01 06:51:43

为什么不兼得? 让demandb.com/foo 和foo.demandb.com 转到同一个地方。

Why not both? Have demandb.com/foo and foo.demandb.com go to the same place.

乖不如嘢 2024-08-01 06:51:43

从技术上讲,子域是不同的服务器。 我工作的公司有一个包含多个子域的域,其中每个子域都位于不同的(虚拟或真实)计算机/服务器上。 这样,如果其中一个崩溃了,其余的仍然可以继续运行。

从开发人员的角度来看,子域将强制子域中的所有内容成为不同的应用程序,而在子文件夹中,子文件夹和子子文件夹可能是根文件夹中应用程序的一部分。 当我创建 Web 应用程序时,通常首先在测试服务器的子文件夹中测试这些 Web 应用程序。 一旦通过测试,它们就会被移动到自己的子域的根目录。

当两个子文件夹彼此相关时,它们通常是同一应用程序的一部分,因此最好将它们保留在自己的子文件夹中,以便它们可以更轻松地共享 cookie 和会话。

Technically, a subdomain is a different server. The company I work for has a domain with several subdomains where every subdomain is located on a different (virtual or real) computer/server. That way, if one of them crashes, the rest just keeps running.

From a developer's perspective, a subdomain would force everything within the subdomain to be a different application while in a subfolder, the subfolder and subsubfolders could be part of the application in the root folder. When I create web applications, those web applications are often tested first on a test server in a subfolder. Once they make it through the tests, they are moved to the root of their own subdomain.

When two subfolders are related to one another, they're often part of the same application, thus it would be better to keep them in their own subfolder so they can share cookies and sessions more easily.

病女 2024-08-01 06:51:43

2 条评论:

  • 如果您需要 SSL,请使用子文件夹 - 那么您只需要 1 个根根证书。
  • 如果您同时使用两者,请确保将 301 重定向到另一个。 这将避免搜索引擎重复问题,但在某些情况下对于 SSL 来说仍然会出现问题。

2 comments:

  • Use sub folders if you need SSL- then you only need 1 basic certificate for the root
  • If you use both, make sure you redirect 301 one to the other. That will avoid the search engine duplication issue, but would still be problematic for SSL in certain situations.
小耗子 2024-08-01 06:51:43

如果您的网站可以轻松地按子域划分,并且每个子域可以独立运行,那么就这样做吧! 然后,您可以通过为每个子域部署不同的服务器(或集群)来轻松扩展您的应用程序。

例子:
Craigslist:按地区(seattle.craigslist.org、sfbay.craigslist.org 等)
Livejournal:按社区/用户 从

技术上讲,您可以使用文件夹来执行此操作,但它需要 Web 代理场,而子域可以使用简单的 DNS 条目来完成。

If your site can be easily partitioned by the subdomains and each subdomain can operate independently then do it! You can then easily scale out your application by deploying different servers(or clusters) for each subdomain.

Examples:
Craigslist: by region(seattle.craigslist.org, sfbay.craigslist.org, etc)
Livejournal: by community/user

Technically, you can do this with folders, but it requires a web proxy farm, whereas subdomains can be done with simple DNS entries.

风铃鹿 2024-08-01 06:51:43

它还取决于您的需求是否需要子域的单独登录系统,因为您使用子文件夹是不可能的。 子文件夹共享同一会话。
对于子域,您必须为所有域设置共享 cookie。

its also depends on your needs whether u want separate login system for sub domains, because it wont be possible is you are using sub-folder. Sub-folder share same session.
For sub domains you have to set shared cookie for all domains.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文