如何配置 Apache2 重定向 URL
问题描述:
我正在尝试在 Apache 中配置 url 重定向.我尝试了一些方法,但没有任何效果.谁能告诉我这个问题的解决方案,因为它看起来并不难.
I am trying to config url redirect in Apache. I have tried some approaches and nothing works. Can someone tell me the solution of this as it doesn't seem too difficult.
我要重定向请求:
https://myhost/configuration/jmx-console
到:
http://myanohterhost/jmx-console
这是一个 https 到 http 重定向.
This is a https to http re-direct.
有人能指出我正确的方向吗?
Can someone point me to the right direction?
非常感谢!
答
您可以使用 RedirectMatch
指令强制 Apache 将用户发送到其他地方:
You could use the RedirectMatch
directive to force Apache to send the user someplace else:
RedirectMatch 301 ^(.*)$ http://www.anotherserver.com$1
请参阅以下内容:
http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirectmatch
http://en.wikipedia.org/wiki/URL_redirection#HTTP_status_codes_3xx