SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru hifigrafix's Avatar
    Join Date
    Oct 2005
    Location
    Nashville, TN
    Posts
    628
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    All of a sudden WWW not working?

    My domain pulls up just fine without WWW (ie. domain.com) but when users inputs www.domain.com the I get a Server Not Found error.

    I tried doing a force rewrite with .htaccess and:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.##domain##\.com$ [NC]
    RewriteRule ^.*$ http://##domain##.com%{REQUEST_URI} [R=301,L]

    but it doesn't solve the problem.

    Any suggestions?

    Thanks
    jw

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    hifi,

    The problem is within your DNS setup which should be contained within a control panel (it's DANGEROUS to mess with DNS records unless you know what you're doing!). If your site is hosted, your host can make the changes (to enable both www and non-www) for you but, to have both available to your site's DocumentRoot (where your .htaccess can access the {REQUEST_URI}), the server needs to know where it is (which it does via the DNS record).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Guru hifigrafix's Avatar
    Join Date
    Oct 2005
    Location
    Nashville, TN
    Posts
    628
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DK,

    thanks for your input. I did check my DNS right off and everything is setup as to speck with the other 38 domains on my dedicated box. There is nothing different. In particular is the CNAME record tied to the www entry. It's all identical to the functioning sites on my server.

    I also checked the httpd.include configuration file which has everything the way it is supposed to be.

    Still clueless.

    thanks
    jon

  4. #4
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you checked the Apache configuration file for a ServerAlias directive? Try putting one in for www.yoursite if it's not there already.

  5. #5
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,605
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    hifi,

    Besides the www record, I also have a * A record assigned to my IP address. The www record will provide the www "subdomain" while the * will provide the non-www.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •