No WWW problem
I have a server with a couple domains on it.
I am running into a problem when users omit the www. on my domains.
How can I make it so whether they call www.domain.com or domain.com they both go to the same place.
I have tried doing it in the httpd.conf but maybe I am doing it wrong.
I.e. if you have www.domain.com as a DNS entry, but you do not allow wildcards and your virtual host only has www.domain.com http://domain.com will not work
Put in wildcard, or better create a dns record for domain.com AND www.domain.com and add both to your vhosts.
(Please correct if I am wrong)
Ok my bad - didnt fully explain problem.
My DNS is fine, it gets the user to my server.
The problem I am having is it the user types in www.domain.com they go to the index page. If they only type domain.com they go to a directory listing.
What can I do about that?
Oh. I remeber that was default behavior on older apache. What version are you running? You need to not allow indexes. I think on newer (2.0X) apache that is default on everything excepts users sites from their home directories. Again not real sure.
Depending on which version you have look in the commonhttpd.conf fiel for something like:
Options -Indexes FollowSymLinks MultiViews
where -indexes means no indexes.
Or add that directive to your virtual host config for that server.
Options -Indexes FollowSymLinks