I have redirection set up so that example.com is redirected to www.example.com
. It is working for the most part but occasionally we detect that a connection is at www.example.com
using the example.com header.
IIS7 on Windows Server 2008
web site #1
bound to one IP address
using host header www.example.com
web site #2
bound to same IP address as web site #1
using host header example.com
has a different home directory than web site #1
redirects to www.example.com
When we test, example.com always redirects to www.example.com
. However, several times a day, the PHP script running on www.example.com
detects that $_SERVER['HTTP_HOST'] is example.com (or sometimes the IP address).
How is this possible? Any ideas how I can configure IIS to reliably redirect every time?