Find the answer to your Linux question:
Results 1 to 4 of 4
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2004
    Location
    SLC, UT
    Posts
    67

    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.

    Thanks!

  2. #2
    Just Joined!
    Join Date
    May 2005
    Posts
    52
    DNS.

    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)

  3. #3
    Just Joined!
    Join Date
    Aug 2004
    Location
    SLC, UT
    Posts
    67
    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?

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    May 2005
    Posts
    52
    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.

    <Directory /web/docs>
    Options -Indexes FollowSymLinks
    </Directory>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •