子文件夹或子域?
我正在为客户建立一个网站,该网站有几个不同的部分,专用于某些主要功能,运行不同的应用程序。 例如,博客(运行 WordPress)、论坛(phpBB)、商店等。
由于所有不同的应用程序,我最初的想法是将主要部分分成单独的子域(www. = blog,论坛、商店等)。 此外,为每个设置单独的 SVN 存储库,以处理未来的升级。
我的问题:这是一个好主意还是坏主意? 我是否最好将这些文件都放在“www”子域的自己的子文件夹中?
我正在研究易于开发、SVN 存储库设置、SEO 影响等。
非常感谢。 乔恩
I'm setting up a site for a client which has a few different sections of the site, dedicated to certain major functions, running off different apps. For example, a blog (running off WordPress), a forum (phpBB), a store, etc.
Because of all the different applications, my initial thought was to separate out the major pieces into separate sub-domains (www. = blog, forum., store., etc). In addition, setup separate SVN repo's for each, to handle future upgrades.
My question: is this a good or bad idea? Am I better off placing each of these in its own sub-folder of the "www" sub-domain?
I'm looking at ease-of-development, SVN repo setup, SEO implications, etc.
Much thanks.
Jon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
当然,我会使用子文件夹。 我知道有一系列缺点,但我现在唯一能想到的是安全证书。
大多数安全证书(用于 https://)不包含子域,或者特定于子域。 如果您计划使用 SSL,或者想要保持网站对 SSL 开放,那么购买与子域一样多的证书将非常昂贵。
就 SEO 而言,只要您的 URL 结构良好,我认为您不会看到任何差异。 典型例子:stackoverflow.com。
I'd use subfolders, for sure. I know there is a list of disadvantages, but the only one I can come up with right now is security certificates.
Most security certificates (used for https://) do NOT include subdomains, or are specific to the subdomain. If you plan on using SSL, or if you want to keep the site open to SSL, it's VERY expensive to purchase as many certificates as subdomains.
As far as SEO, as long as your URLs are well structured, you won't see a difference in my opinion. Case in point: stackoverflow.com.
使用子域。 除此之外,它们更容易记住。
Go with subdomains. Among other things, they're easier to remember.
关于SEO,两种方式都有其优点和缺点:
http://www.searchenginejournal.com/subdomains-or-subfolders-which-are-better-for-seo/6849/
Regarding SEO, both ways have their advantages and drawbacks:
http://www.searchenginejournal.com/subdomains-or-subfolders-which-are-better-for-seo/6849/
子域为您提供更多权力。
最重要的方面是您的网站的功能可以在不同的虚拟提供商之间分配。 我的意思是,如果您运行“example.com”并且您想要为您的网站创建一个博客,那么请使用“blog.example.com”。 为什么? 这样一来,您的博客就可以驻留在 Blogger 上,利用其带宽和资源。 如果您有“example.com/blog”,那么您基本上必须安装 Wordpress 或自行托管它。
子域还允许您分段 cookie。 Cookie 可以应用于子域,这意味着其他人看不到它。 您可以为父域设置 cookie,所有子域都会看到它。 这对您是否有用取决于您的应用程序。
缺点是每个子域可能需要自己的 SSL 证书。 您还可能会遇到子域之间的跨站点脚本问题。
Subdomains give you more power.
The most important aspect to this is that the functionality of your site can be split between different virtual providers. By this I mean that if you run "example.com" and you want a blog for your site, then use "blog.example.com". Why? Well, that way your blog can reside on Blogger, using their bandwidth and resources. If instead you have "example.com/blog" then you basically have to install Wordpress or otherwise host it yourself.
Subdomains also allow you to segment cookies. Cookies can apply to a subdomain meaning the others won't see it. Of you can set the cookie for the parent domain and all the subdomains will see it. Whether or not this is useful to you depends on your application.
A downside is that each subdomain may require its own SSL certificate. You may also run into cross-site scripting issues between subdomains.
我最近遇到了同样的问题,必须考虑以下问题:
客户端是否有通配符 DNS 记录,如果没有,为子域进行正确的 DNS 更改需要付出多少努力和周转时间?
用户将如何访问子域/文件夹中的页面? 这些应用程序是独立存在的,还是通过主域访问它们,以便用户可能不会注意到其中的差异?
根据我对这些问题的具体回答,我选择了子文件夹路线。
I recently faced the same question and had to consider the following:
does the client have a wildcard DNS record, and if not, what is the effort and turnaround time to get the proper DNS changes made for a subdomain?
how will users access the pages in the subdomain/folder? Do these applications stand by themselves, or are they accessed through the main domain anyways, so that users probably don't even notice the diference?
Based on my specific answers to these questions, I went the subfolder route.