Apache Reference Manual (12)

Source: Internet
Author: User
Tags reverse dns
USECANONICALNAME directive
Syntax:usecanonicalname On|off|dns
Default:usecanonicalname on
Context:server config, virtual host, directory
Override:options
Compatibility:usecanonicalname is only available in Apache 1.3 and later
In many situations Apache has to construct a self-referential URL. This is, a URL which refers the same server. With Usecanonicalname on ("and" versions prior to 1.3) Apache would use the ServerName and Port directives to Construc T a canonical name for the server. The this name is used the self-referential URLs, and for the values of server_name and Server_port in CGIs.
With Usecanonicalname off Apache would form self-referential URLs using the hostname and port supplied by the client if any are supplied (otherwise it'll use the canonical name). These values are the "Same" are used to implement name based virtual hosts, and are available with the same clients. The CGI variables server_name and Server_port is constructed from the client supplied values as.
An example where it may be useful was on a intranet server where you have users connecting to the machine using short NA Mes such as www. You'll notice that if the users type a shortname, and a URL which is a directory, such as Http://www/splat, without the TR Ailing Slash then Apache would redirect them to http://www.domain.com/splat/. If You are have authentication enabled, this'll cause the user to have to reauthenticate twice (once for WWW and once again For www.domain.com). But if Usecanonicalname is set off, then Apache would redirect to http://www/splat/.
There is a third option, Usecanonicalname DNS, which are intended for use with mass ip-based virtual hosting to support ANC Ient clients that does not provide a host:header. With this option, Apache does a reverse DNS lookup on the server IP address, the client connected to, to work O UT self-referential URLs.
Warning:if CGIs make assumptions about the values of server_name they may is broken by this option. The client is essentially free to give whatever value they want as a hostname. The But if the server_name to construct self-referential URL then it should be just fine.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.