在此 URL ( http://www.seomoz.org/learn-seo/domain) 中,以下是子域或子文件夹部分:
- Subdomains or Sub-folders
Since search engines keep different metrics for domains than they do subdomains, it is recommended that webmasters place link worthy content like blogs in subfolders rather than subdomains. (i.e. www.example.com/blog/ rather than blog.example.com) The notable exceptions to this are language-specific websites. (i.e., en.example.com for the English version of the website).
所以,这是我在网络服务器 (Apache2) 级别使用 mod_rewrite
处理的情况
我有一个运行在 http://example.com
现在我想在 http://blog.example.com
我想要的是,如果用户点击 http://example.com/blog
或任何带有 /blog/.....
的 url,我想在不更改 URL 地址的情况下显示 http://blog.example.com
或 http://blog.example.com/....
的内容。
我知道它应该在 apache2 服务器级别处理,因为如果它点击 http://example.com/blog
的 url,它将在 路由中搜索匹配项.rb
文件。
那么,在 apache2 中使用 .htaccess
文件来处理这个问题的 mod_rewrite
规则是什么?
最佳答案
您实际上最好使用 mod_proxy
而不是 mod_rewrite
。 See the ProxyPass docs here.
关于ruby-on-rails-3 - 如果访问 url 之类的子文件夹,Apache 会提供不同的应用程序内容吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11194985/