http best practice for redirecting ip address

by Mike   Last Updated November 19, 2017 03:04 AM

I plan to have 2 TLD pointing to the same apache installation with wordpress multisite. I can set virtualhosts correctly for each domain, no problems. I can have both domains point to the same host, no worries.

Currently I have a redirect for all traffic hitting the web server IP address to my initial domain.

<VirtualHost *:80>
<Directory "/share/Web/WordPress">
        Options FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
</Directory>
        ServerName 1.1.1.100
        Redirect / https://www.example.com/
</VirtualHost>

What is the best practice for redirecting the IP address when 2 TLD point to the same IP?

I would like to prevent someone doing an nslookup on the 2nd TLD, typing that in a browser and being redirected to the 1st TLD.

I thought about creating a generic 404 page and having that displayed when hitting the ip address. However I believe this will hurt my SOE on both TLD.



Related Questions


Different page for different IP & domain

Updated May 29, 2017 19:04 PM


Vanity URLs with .htaccess and PHP?

Updated August 20, 2015 17:01 PM

Redirect ALL requests to host IP

Updated May 26, 2016 08:01 AM