Masking domains with redirects is going to get messy plus all those redirects may not play nice for SEO. Rails doesn't care if you host everything under a common domain name. It's just as easy to detect the requested domain name as it is the requested subdomain.
I suggest pointing all of your end-user domains directly to the IP of your main server so that redirects are not required. Use the the :domain and :subdomain conditions in the Rails router or parse them in your application controller to determine which site to actually render based on the hostname the user requested. This gives you added flexibility later as you could tell Apache or Nginx which domains to listen for and setup different instances of your application as to support rolling upgrades and things like that.
Sounds like this was @wukerplank's approach and I agree. Custom router to look at the domain name of the current request keeps the rest of your application simple.
There will you get some more help by getting site details of existing online site builder you can look upon [wix][1] , [weebly][2] , ecositebuilder and word press and many
发布评论
评论(2)
用重定向屏蔽域名会变得混乱,而且所有这些重定向可能对 SEO 不利。 Rails 并不关心您是否在公共域名下托管所有内容。检测所请求的域名与检测所请求的子域一样容易。
我建议将所有最终用户域直接指向主服务器的 IP,这样就不需要重定向。使用 Rails 路由器中的 :domain 和 :subdomain 条件或在应用程序控制器中解析它们,以根据用户请求的主机名确定实际渲染哪个站点。这为您以后提供了更大的灵活性,因为您可以告诉 Apache 或 Nginx 要侦听哪些域并设置应用程序的不同实例以支持滚动升级等。
听起来这是@wukerplank 的方法,我同意。用于查看当前请求的域名的自定义路由器使应用程序的其余部分保持简单。
Masking domains with redirects is going to get messy plus all those redirects may not play nice for SEO. Rails doesn't care if you host everything under a common domain name. It's just as easy to detect the requested domain name as it is the requested subdomain.
I suggest pointing all of your end-user domains directly to the IP of your main server so that redirects are not required. Use the the :domain and :subdomain conditions in the Rails router or parse them in your application controller to determine which site to actually render based on the hostname the user requested. This gives you added flexibility later as you could tell Apache or Nginx which domains to listen for and setup different instances of your application as to support rolling upgrades and things like that.
Sounds like this was @wukerplank's approach and I agree. Custom router to look at the domain name of the current request keeps the rest of your application simple.
通过获取现有在线网站构建器的网站详细信息,您将获得更多帮助,您可以查看 [wix][1] 、 [weebly][2] 、 ecositebuilder 和 word press 等等
There will you get some more help by getting site details of existing online site builder you can look upon [wix][1] , [weebly][2] , ecositebuilder and word press and many