mod_rewrite的工作不作为内部代理 [英] mod_rewrite not working as internal proxy

查看:147
本文介绍了mod_rewrite的工作不作为内部代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要使用mod_rewrite直接流量www.example.com改为123.45.67.89网站,8080端口,通过内部的代理。这是我使用重写规则:

I have a site that needs to use mod_rewrite to direct traffic to www.example.com to 123.45.67.89, port 8080, through an internal proxy. This is the rewrite rule I'm using:

RewriteEngine On
RewriteRule ^(.*)$ http://123.45.67.89:8080/$1  [P]

当我访问www.example.com/myurl,我收到以下错误与404:

When I visit www.example.com/myurl, I receive the following error with a 404:

请求的URL / myurl在此服务器上找到。

The requested URL /myurl was not found on this server.

此重定向的工作原理我们开发服务器上,而不是生产。有没有办法,我需要为了使使这项工作在Apache设置?

This redirect works on our dev server, but not on production. Is there an apache setting that I need to enable in order to make this work?

感谢

推荐答案

您需要拥有的启用使用 href=\"http://httpd.apache.org/docs/2.2/mod/mod%5Frewrite.html#rewriteflags\" rel=\"nofollow\"> P 标志

You need to have mod_proxy enabled to use the P flag.

这篇关于mod_rewrite的工作不作为内部代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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