Forum Moderators: phranque

Message Too Old, No Replies

Blocking Domains On a Server

         

Mark Wallace

11:43 am on Sep 15, 2010 (gmt 0)

10+ Year Member



The way my server is setup whenever someone points a domain to it's IP it returns the first website that was uploaded to that server.

This creates an exact replica of my original website but with the other person's domain.

This has hurt my rankings and traffic so I was looking for a way to block any domain that would point to my server except for the domains that are setup or that I would specify.

Any ideas?

lammert

2:00 pm on Sep 15, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you have more than one website on your server, then name based virtual host serving has probably already been switched on.

The easiest way is to create an empty <VirtualHost> container in the httpd.conf file before the virtual host which contains your current main website. This virtual host will catch all requests for a non-existent domain or direct IP address. You can configure this virtual host to respond with 404 or 403 answers for all requests.

Mark Wallace

2:04 pm on Sep 15, 2010 (gmt 0)

10+ Year Member



Thanks allot for your help lammert, I'll start working on your suggestion and post back what I can come up with.

Mark Wallace

2:18 pm on Sep 21, 2010 (gmt 0)

10+ Year Member



I tried setting up these 2 configurations but none did the trick:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName host
ServerPath /public_html/
DocumentRoot /public_html/
</VirtualHost>


NameVirtualHost *:80

<VirtualHost *:80>

</VirtualHost>


It still returns the website that was uploaded first to the server if I point a domain to it.

Mark Wallace

3:44 pm on Sep 21, 2010 (gmt 0)

10+ Year Member



Solved it :)

The empty virtual hosts needed to be configured for each server IP in the turbopanel.conf file, above the first virtual host, as you said, setup for each IP.

Thanks for your help.