阿帕奇协议重定向
是否有可能让 apache 获取像whateverProtocol://localhost 这样的请求并将其重定向到 http://localhost ?
提前致谢。
更新:谢谢您的回答。具体来说,我正在尝试将 ldap://localhost 重定向到 http://localhost——并且我相信 ldap 可能会被 mod_rewrite 识别。但到目前为止,使用 RewriteEngine/RewriteRule 还没有成功,包括使用 RewriteCond SERVER_PROTOCOL...
任何想法将不胜感激。
Is it possible to have apache get a request like whateverProtocol://localhost and redirect it to http://localhost?
Thanks in advance.
Update: Thank you for the answers. Specifically, I am trying to redirect ldap : // localhost to http : // localhost -- and I believe ldap may be recognized by mod_rewrite. But no luck so far using RewriteEngine/RewriteRule, including using RewriteCond SERVER_PROTOCOL...
Any ideas would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不明白这怎么可能行得通。 Apache 是一个 HTTP 服务器,而不是 LDAP 服务器,因此它首先不会收到请求。即使您让它为端口 631 提供请求,LDAP 客户端也不会发送 HTTP 请求,并且无法解析重定向响应。
I don't see how this could possibly work. Apache is an HTTP server, not an LDAP server, so it wouldn't get the request in the first place. Even if you had it serve requests for port 631, an LDAP client wouldn't send an HTTP request and wouldn't be able to parse a redirect response.
一般来说,没有。大多数协议不包含重定向到其他协议的方法。
对于 HTTPS,您可以。这只是一个问题:
...在 HTTPS 虚拟主机的配置中。
更新以响应编辑:
虽然理论上可以说服 Apache 与 LDAP 对话(它的模块可以将其用作任何类型的 TCP/IP 服务器的基础),但 LDAP 客户端不能谈论 HTTP,所以这样的重定向没有任何意义。 (我认为 LDAP 也不支持重定向响应)。
In general, no. Most protocols don't include a method for redirecting to a different one.
In the case of HTTPS, you can. That is simply a matter of:
… in the configuration for the HTTPS virtual host.
update in response to edit:
While it is theoretically possible to persuade Apache to talk to LDAP (modules for it can use it as the base for any kind of TCP/IP server), LDAP clients don't talk HTTP, so such a redirect wouldn't make any sense. (I don't think LDAP supports a redirect response either).
mod_rewrite 似乎是您所寻找的:
http://httpd.apache.org /docs/2.2/mod/mod_rewrite.html
希望这有一些帮助
mod_rewrite seems to be what your lookiing for:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
Hope this is of some help