.htacess与[P]代理标志重写 [英] .htacess rewriting with the [P] proxy flag

查看:215
本文介绍了.htacess与[P]代理标志重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过的.htaccess和代理标志做一个隐形(透明?)重写。它的工作原理与[R]标志,但不能用[P]标志,因为它只是给出了一个500错误。两个域分别在不同的服务器和mod_proxy的模块已启用。是我的.htaccess是否正确?

I am trying to do an invisible (transparent ?) rewrite via .htaccess and the proxy flag. It works with the [R] flag but not with the [P] flag because it just gives a 500 error. The two domains are on separate servers and the mod_proxy module is enabled. Is my .htaccess correct ?

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST}    =one.com
RewriteRule ^(.*)$          http://two.com/$1 [P]

感谢您的帮助!

推荐答案

如果的mod_proxy 被编译为一个共享的模块,它需要你明确地加载相关的子模块了。这可能是您的服务器上的 mod_proxy_http 未启用,从而导致内部服务器错误时,的mod_proxy 尝试处理请求传递给它由的mod_rewrite

If mod_proxy was compiled as a shared module, it requires that you explicitly load the relevant submodules too. It's possible that on your server mod_proxy_http is not enabled, which leads to an internal server error when mod_proxy tries to handle the request passed to it by mod_rewrite.

的mod_proxy 像你说的本身也启用和可能的工作,因为如果你没有启用它,使用的P 标志将只产生404响应。很难确切知道虽然没有错误日志,所以你做需要找一个人能够访问它,看看发生了什么事情来帮助你解决问题。

mod_proxy itself is enabled like you said and likely working, since if you don't have it enabled, use of the P flag will just generate a 404 response. It's hard to know for sure though without the error log, so you made need to find someone with access to it to see what's going on to help you resolve the problem.

这篇关于.htacess与[P]代理标志重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆