DekGenius.com
I l@ve RuBoard Previous Section Next Section

2.7 Pointing a Domain Name to a Particular URL

2.7.1 Problem

You want people who access one of your domain names to reach a particular URL.

2.7.2 Solution

Add an A record to the zone to which the domain name belongs, pointing to the IP address of the web server:

mylink.foo.example.    IN    A    10.0.0.1 

Then configure the web server to direct browsers requesting http://mylink.foo.example to the appropriate directory on your web server.

2.7.3 Discussion

Most of this solution is configured on the web server using a facility called "virtual hosts." The web server needs to associate your domain name, when it appears in the HTTP/1.1 "Host" header, with a particular "document root," a directory in the web server's document tree.

If the domain name of the web server is in a zone run by someone else, or you already have a domain name in your zone pointing to the address of the web server, you can use a CNAME record instead of an A record:

mylink.foo.example.    IN    CNAME    www.isp.net.

This way, if the IP address of the web server changes, your domain name will continue to point to the right place.

Of course, if someone else runs the web server, you'll need their cooperation to set up the association between mylink.foo.example and the appropriate directory.

2.7.4 See Also

Section 2.6 for pointing a domain name at a web server, the Apache Software Foundation's online documents on virtual hosts at http://httpd.apache.org/docs/vhosts/name-based.html and http://httpd.apache.org/docs-2.0/vhosts/, and "HTTP/1.1 Virtual Hosts" in Chapter 3 of Apache: The Definitive Guide.

    I l@ve RuBoard Previous Section Next Section