I am rebuilding an old server. Only one of the five old sites need to go live and all five of the old sites point to the same IP address.
Unfortunately any time a request is made for one of the old sites via their own unique domain names they are passed the pages from the one site that I'm trying to make live. I would just like the old sites to display a 404 instead of the one site that I'm actually trying to make live.
As an example:
- Site 1 (192.168.0.1) [www.first.com]
- Site 2 (192.168.0.1) [www.second.com]
- Site 3 (192.168.0.1) [www.third.com]
I want to move site 1 live again. So I turned on apache on the machine with the IP address of 192.168.0.1, with all of site 1's files in the /var/www directory. When I browse to 192.168.0.1 or www.first.com I correctly see site 1. When I browse to www.second.com and www.third.com I also receive site 1 which is the problem.
Is there a way I can 404 any request which comes in without www.first.com?
Here is my sites-available:
NameVirtualHost *:80 LogFormat "%h %l %u %t \"%r\" %>s %b" common <Files ~ "^\.ht"> Order allow,deny Deny from all Satisfy All </Files> <Directory /> Order Deny,Allow Deny from all Options None AllowOverride None Options None </Directory> <Directory /var/www> Order Allow,Deny Allow from all </Directory> <VirtualHost *:80> ServerName first.com ServerAlias www.first.com DocumentRoot /var/www ErrorLog /var/log/first.com.err CustomLog /var/log/first.com.log common </VirtualHost> <VirtualHost _default_:*> ServerName unknown DocumentRoot /var/www_404 </VirtualHost>