ruby-on-rails-3 - 如果访问 url 之类的子文件夹,Apache 会提供不同的应用程序内容吗?

标签 ruby-on-rails-3 mod-rewrite apache2

在此 URL ( http://www.seomoz.org/learn-seo/domain) 中,以下是子域或子文件夹部分:

  1. 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

的 Rails 应用程序

现在我想在 http://blog.example.com

上托管一个博客,它是一个 PHP 应用程序 WordPress

我想要的是,如果用户点击 http://example.com/blog 或任何带有 /blog/..... 的 url,我想在不更改 URL 地址的情况下显示 http://blog.example.comhttp://blog.example.com/.... 的内容。

我知道它应该在 apache2 服务器级别处理,因为如果它点击 http://example.com/blog 的 url,它将在 路由中搜索匹配项.rb 文件。

那么,在 apache2 中使用 .htaccess 文件来处理这个问题的 mod_rewrite 规则是什么?

最佳答案

您实际上最好使用 mod_proxy 而不是 mod_rewriteSee the ProxyPass docs here.

关于ruby-on-rails-3 - 如果访问 url 之类的子文件夹,Apache 会提供不同的应用程序内容吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11194985/

相关文章:

php - 使用 .htaccess 将子域重定向到特定目录

ruby-on-rails - 压缩来自 Rails 应用程序的 JSON 响应

php - 通过 php 通过 http 执行 git 命令

ruby-on-rails - 如何在 Rails 中跟踪用户事件?

ruby-on-rails-3 - MongoDB设置: mongo.日志权限错误?

php - 如何停止 RewriteEngine/PHP 重定向循环?

.htaccess - 在 .htaccess 重定向中保留 HTTP/HTTPS 协议(protocol)

windows - Apache 2 - 在 Windows 上重新加载配置

ruby-on-rails - Active Record/Rails 3.2/PostgreSQL 数据库中连接模型属性的数据类型

jquery - uploadify 不断为每个上传请求提供新的 session