ApacheReferenceManual (12) _ PHP Tutorial

Source: Internet
Author: User
Tags reverse dns
ApacheReferenceManual (12 ). Usecanonicalnamedirevesyntax: UseCanonicalNameon | off | dnsDefault: UseCanonicalNameonContext: serverconfig, virtualhost, directoryOverride: OptionsCompatibility: UseCanon 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. that is, a URL which refers back to the same server. with UseCanonicalName on (and in all versions prior to 1.3) Apache will use the ServerName and Port directives to construct a canonical name for the server. this name is used in all self-referential URLs, and for the values of SERVER_NAME and SERVER_PORT in CGIs.
With UseCanonicalName off Apache will form self-referential URLs using the hostname and port supplied by the client if any are supplied (otherwise it will use the canonical name ). these values are the same that are used to implement name based virtual hosts, and are available with the same clients. the CGI variables SERVER_NAME and SERVER_PORT will be constructed from the client supplied values as well.
An example where this may be useful is on an intranet server where you have users connecting to the machine using short names 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 trailing slash then Apache will redirect them to http://www.domain.com/splat. if you have authentication enabled, this will 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 will redirect to http: // www/splat /.
There is a third option, UseCanonicalName DNS, which is intended for use with mass IP-based virtual hosting to support specified Ent clients that do not provide a Host: header. with this option Apache does a reverse DNS lookup on the server IP address that the client connected to in order to work out self-referential URLs.
Warning: if CGIs make assumptions about the values of SERVER_NAME they may be broken by this option. the client is essential free to give whatever value they want as a hostname. but if the CGI is only using SERVER_NAME to construct self-referential URLs then it shoshould be just fine.

Http://www.bkjia.com/PHPjc/629543.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/629543.htmlTechArticleUseCanonicalName directive Syntax: UseCanonicalName on | off | dns Default: UseCanonicalName on Context: server config, virtual host, directory Override: Options Compatibility: UseCanon...

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.