Apache mod_rewrite 不起作用

Apache mod_rewrite 不起作用

我必须通过 mod_rewrite 将所有请求从一个 apache 代理到另一个。

加载了 mod_proxy 和 mod_rewrite 并且我配置了 apache 如下:

<VirtualHost *:8009>
    Options  +FollowSymLinks -Multiviews
    ......
    RewriteEngine on
    RewriteRule ^/abc/(.*)    http://anotherhost/abc/$1    [P,L]
    ....
</VirtualHost>

但是 Apache 返回给我 505。

这是 Apache 在重写日志中写的内容:

- - [16/Sep/2010:14:13:06 +0200] [myhost/sid#7f9472e763b8][rid#7f94731a6c78/initial] (2) forcing proxy-throughput with http://otherhost/abc/
- - [16/Sep/2010:14:13:06 +0200] [myhost/sid#7f9472e763b8][rid#7f94731a6c78/initial] (1) go-ahead with proxy request proxy:http://otherhost/abc/ [OK]

错误日志中出现此信息:

[warn] proxy: No protocol handler was valid for the URL /abc/. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

我遗漏了什么?

答案1

确保您已经加载了两个模块mod_proxy以及支持模块(即mod_proxy_http)。

祝你好运!

相关内容