[resolved] "www" not resolving but just teh domain name works (5 posts)

  1. BTBTB
    Posted 4 years ago #

    This just started happening and I have multiple WordPress installs on this server. It happens with all of my WordPress installs on this server. when I use http://www.DomainName.com it resolves to a blank page

    Here is the issue
    when I just use the domain name without the www prefix WordPress loads the site perfectly.

    It just started happening... we confirmed that it is not a DNS issues as other sites on this server work fine with the www. prefix, its just the WordPress installations.

    Was I hacked and if so, or is there a fix?

    Thank you

  2. Try adding the following code to your htaccess file:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,
  3. BTBTB
    Posted 4 years ago #

    Thanks Andrew - that did indeed solve the problem. Would you know why these lines could have been removed from the htaccess file? None of our administrators were working on the site and this seemed to have happen to all of our WordPress installations on the shared "localhost" server. I'm wondering if I should be looking at any plugins or themes but they are seem pretty standard?

  4. I'm not sure why that would've happened. If you recently upgraded WordPress, that might be it. I had to have WordPress re-initialize my htaccess after a recent update (though it was a beta update, so I don't know if that applies here.)

  5. Also, you said it was a localhost server. Is it apache or something else? Did you update it recently? It might have changed how it handles htaccess handling.

Topic Closed

This topic has been closed to new replies.

About this Topic