[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] [550] DNS -- redirect to a default URL



At 05:55 PM 3/24/2004, you wrote:
Today, a mistyped URL is redirected to the top A record
in the records file...and that is not our home page but a hosted subdomain,
i.e., subdomain.my.domain.com.

How do I change this behavior so a mistyped URL redirects to
www.my.domain.com?  Can I simply rearrange the entries in the records file,
putting www.my.domain.com as the topmost entry?

Okay. Well I think your problem is with Apache and not with DNS.
What happens is that your DNS provider is pointing the *.mydomain.com to the IP of your machine. Since you don't have site setup with all possible aliases of *.mydomain.com, Apache doesn't recognize it as belonging to a particular site so what it does is serve the pages from the first <VirtualHost> block that it encounters.

What the 550 apache setup does is create an include file for each site. These includes are located here: /etc/httpd/conf/vhosts
It then loads them all at the bottom of httpd.conf like this:
Include /etc/httpd/conf/vhosts/site1
Include /etc/httpd/conf/vhosts/site2
Include /etc/httpd/conf/vhosts/site3
Include /etc/httpd/conf/vhosts/site4

So, if your main site number changed when you CMU-Imported then it's likely not the first one listed to be included.

Find the site number of your main site and move it to the top of this list. For instance if your main site is now site4 then do this:

Include /etc/httpd/conf/vhosts/site4
Include /etc/httpd/conf/vhosts/site1
Include /etc/httpd/conf/vhosts/site2
Include /etc/httpd/conf/vhosts/site3

Then restart apache and test it.

Brian