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.
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).