The domain points to an A-Record name server, and as of now the name servers are defaulted to registrar (GoDaddy). I went into /var/www directory and edited index.html to <meta http-equiv="refresh" content="0; url=http://siteB.com/" />, and now only www.example.com redirects to site B. non-www still points to site A. How can I have both non-www and www point to site B? Or better yet, how do I know where index.html for non-www is? I'm no Apache wiz, but I have webmin with Apache Webserver.

  • Are you certain it is loading the same index.html? Put some identifying code in it
    – Steve
    Jan 11, 2015 at 0:56
  • @Steve It is not loading the same index.html. previously, the nameservers were pointed to enjin, no need for index.html
    – user48767
    Jan 11, 2015 at 1:02
  • 1
    Your question is a bit confusing. This should be easy to fix. I suspect that your DNS records are not quite right and a small one or two adjustments and all will work the way you want. Can you give us an anonymous example of how all your DNS records are set up? I suspect that an A record and CNAME change will fix your problem.
    – closetnoc
    Jan 11, 2015 at 3:52

1 Answer 1


I wouldn't recommend using HTML meta tags to manage redirects. Go into your root directory, find the .htaccess file and add this to the top.

# This allows you to redirect your entire website to any other domain

Redirect 301 / http://siteB.com/

You may have to edit your settings to view that file because most programs hide the .htaccess file by default. This will redirect all pages to that site. If you have pages that exist in A but not B, you are going to get 404 errors on those redirects.

  • Funny thing is, I don't have an .htaccess for the index.html in /var/www. I have multiple .htaccess per-page for a gameserver control panel, however.]]\=
    – user48767
    Jan 11, 2015 at 17:04
  • If you don't have one, you can create a file. More likely you do have one and just don't have it visible. Good test would be to create a new one and see if you can see it.
    – BradHanks
    Jan 12, 2015 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.