Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Apache with and without a WWW prefix in my domain name
Results 1 to 2 of 2

Thread: Apache with and without a WWW prefix in my domain name

  1. #1
    Administrator Associate gr8rcake's Avatar
    Join Date
    May 2004
    Posts
    44

    Apache with and without a WWW prefix in my domain name

    Hello,

    I have just registered a domain. How can I setup DNS to have a foo.com and a www.foo.com domain?

    How can I set Apache to automatically redirect all foo.com requests to www.foo.com?

    The websites for both domains are hosted on the same server.

  2. #2
    Administrator Moderator
    Member
    starfish's Avatar
    Join Date
    Apr 2004
    Posts
    141
    I had this problem some time ago. This fixed it, and works with all sub-directectories under foo.com without getting a 404 error.


    Code:
    ;DNS Zone File
    ;=============
    
    foo.com.   IN      A       11.12.13.14
    www        IN      A       11.12.13.14
    
    
    # httpd.conf file
    #================
    
    <VirtualHost *&#58;80>
        ServerName  www.foo.com
        DocumentRoot /var/www/html/foo
    </VirtualHost>
    
    
    <VirtualHost *&#58;80>
        ServerName  foo.com
        Redirect /  http&#58;//www.foo.com/
    </VirtualHost>

Similar Threads

  1. forwarding non-existent user to remote hosted domain of same domain name?
    By pushpraj nimbalkar in forum Redhat / Fedora
    Replies: 3
    Last Post: 07-18-2006, 09:50 PM
  2. Domain ?
    By vern in forum Announcements and Suggestions
    Replies: 19
    Last Post: 11-05-2005, 08:51 PM
  3. Domain Name Hosting retrieval of domain?
    By Rastar in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 04-16-2003, 03:46 PM
  4. Having a little fun with my new domain name...
    By gmoreno in forum General Chat
    Replies: 13
    Last Post: 08-31-2002, 07:29 PM
  5. Domain, DNS is it possible
    By Kaiser_Sose in forum Linux - Hardware, Networking & Security
    Replies: 44
    Last Post: 02-19-2002, 04:30 AM

Bookmarks

Posting Permissions

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