如何配置 Apache2 重定向 URL [英] How to config Apache2 to redirect URL

查看:42
本文介绍了如何配置 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

这篇关于如何配置 Apache2 重定向 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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