一般会增加
LoadModule rewrite_module modules/mod_rewrite.so
但写个 (.*)rewrite 到www.baidu.com发现没有成功
开启rewirte日志
在apache(2.2版本)的配置文件中增加
RewriteLog “/myfolder/mylogfile.log” RewriteLogLevel 9
apache版本2.4及以上
LogLevel alert rewrite:trace3
其中,记录等于由trace1~trace8,数值越大,记录的信息越多。你将能够在你的 apache配置的error_log 中看到这些信息。
打开errorlog,如果vhost下配置了独立的errorlog需要到独立的errorlog文件里看,否则在公共的errorlog里看不到
 [proxy:warn] [pid 18980:tid 4476780544] [client 127.0.0.1:50525] AH01144: No protocol handler was valid for the URL /ROOT. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
意思是要开启proxy模块
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so
打开后,再重启,好可成功
看下apache的文档
‘proxy|P’ (force proxy)
This flag forces the substitution part to be internally forced as a proxy request and immediately (i.e., rewriting rule processing stops here) put through the proxy module. You have to make sure that the substitution string is a valid URI (例如,typically starting with http://hostname) which can be handled by the Apache proxy module. If not you get an error from the proxy module. Use this flag to achieve a more powerful implementation of the ProxyPass directive, to map some remote stuff into the namespace of the local server.
注意:mod_proxy must be enabled in order to use this flag.
意思是使用到P标签,必须要开 mod_proxy,很显然P是做代理功能,当然要开启代理模块了。

Comments are closed.

Post Navigation