A serious issue is occurring for a client of mine who is using Virtualmin Pro.
After creating a new virtual server, and installing Wordpress using the install script, the site cannot be browsed if only using the non-www domain name. If you browse to www.domain.com, then you land on the Wordpress setup page. Conversely, if you browse to http://domain.com/, then a 301 is issued with the location header set to http://other-domain.com. The browser then obviously redirects to other-domain.com.
I have tested a few things already:
- DNS is set correctly at the DNS registrar for this domain - there are *, @ and other subdomain records.
- It is not Wordpress. I have tested this by removing Wordpress and, with Wordpress still installed, renaming index.php, and replacing it with an index.html file. The same behaviour occurs regardless of what's installed in /home/domain/public_html.
- There is no .htaccess file specifying this type of URL re-write, and /etc/httpd/cond/httpd.conf seems only to contain valid, "clean" definitions of the virtual servers
- It is something to do with Apache. I say this because if you browse to:
- This appears to be only a problem when you are visiting the root domain, without a file.
- I have tested the HTTP headers using CURL. We get a 200 if browsing www.domain.com, www.domain.com/index.php and domain.com/index.php. We only get a 301 if browsing domain.com/
- If I create a virtual server for third-domain.com, I do not get these problems.
I can see that this strongly suggests a rewrite rule is at play somewhere. However, this issue seems to recur - we have deleted and re-created the virtual server, and the same behaviour persists. It's almost as is Apache has a special "fondness" for this domain.com.
Could you recommend the best steps to take next and/or assist with diagnosing this problem please?