-2

I'm trying to figure out whether a website I use was hacked.

When I access the site via www.site-name.com, I'm taken to the website.

However, when I access the site without the "www," i.e. site-name.com, I'm taken to a different website.

Why is this happening? I did a little research and my only guess is that someone changed the site's .htaccess file, but that seems unlikely, as the different website has no relation to the official site.

Can someone help me understand what's going on here?

1 Answers1

1

One IP address can host multiple websites with different hostnames using Virtual Name Hosting.

The HTTP server will look at the Host header in the request to determine what site to use for a given request.

This lets you have one IP address serving example.com and example.net.

Typically, the first Virtual Name Host will be the default, so if you were to ask for example.org the server would not recognise it and give you example.com instead.

In this case, it appears that the server has a Virtual Name Host configured for www.site-name.com but not for site-name.com so requests for site-name.com get the default site for the server.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Thanks! Does this mean the owner of the URL controls where it redirects without the www? – Brian Patrick Byrne Oct 12 '17 at 16:03
  • 1
    The owner of the domain controls what DNS servers it points to. The owner of the DNS servers controls what IP address the domain and any of its subdomains point to (they can be different). The owner of the computer the IP address points to controls what content gets served up for each URL. – Quentin Oct 12 '17 at 16:13