Apache2保持redirect

我试图保持在www.mydomain.deurl上的用户,但Apache使用301redirect到mydomain.de。我可以如何防止这种情况?

httpd.include为虚拟主机

<VirtualHost xx.xx.xx.xx:80> ServerName mydomain.de:80 ServerAlias www.mydomain.de UseCanonicalName off SuexecUserGroup mydomain psacln ServerAdmin "[email protected]" DocumentRoot /var/www/vhosts/mydomain.de/httpdocs </VirtualHost> 

DNS设置

  ; *** This file is automatically generated by Plesk *** $TTL 86400 @ IN SOA ns.mydomain.de. info.mydomain.de. ( 1246541440 ; Serial 10800 ; Refresh 3600 ; Retry 604800 ; Expire 360 ) ; Minimum mydomain.de. IN NS ns.mydomain.de. mydomain.de. IN NS ns2.hans.hosteurope.de. ns.mydomain.de. IN A 92.51.134.24 mydomain.de. IN A 92.51.134.24 webmail.mydomain.de. IN A 92.51.134.24 mail.mydomain.de. IN A 92.51.134.24 science.mydomain.de. IN A 92.51.134.24 test.mydomain.de. IN A 92.51.134.24 testing.mydomain.de. IN A 92.51.134.24 ftp.mydomain.de. IN CNAME mydomain.de. www.mydomain.de. IN CNAME mydomain.de. *.webmail.mydomain.de. IN CNAME mydomain.de. mydomain.de. IN MX 10 mail.mydomain.de. mydomain.de. IN TXT "v=spf1 +a +mx -all" 

任何想法,为什么发生这种情况? 谢谢!

编辑:感谢您的input混沌(不能投票你的答案呢),但不幸的是,它仍然无法正常工作。

Fiddler2输出

 GET / HTTP/1.1 Accept: */* Accept-Language: de UA-CPU: x86 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 4.0.20506; InfoPath.2; .NET CLR 3.0.30729) Host: www.mydomain.de Proxy-Connection: Keep-Alive HTTP/1.0 301 Moved Permanently Date: Thu, 02 Jul 2009 18:38:34 GMT Server: Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_python/3.3.1 Python/2.5.2 PHP/5.2.10 mod_perl/2.0.3 Perl/v5.8.8 X-Powered-By: PHP/5.2.10 X-Pingback: http://mydomain.de/xmlrpc.php Location: http://mydomain.de/ Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Cache: MISS from dezntpx01.computacenter.de X-Cache-Lookup: MISS from dezntpx01.computacenter.de:8081 X-Cache: MISS from dezntpx03.computacenter.de X-Cache-Lookup: MISS from dezntpx03.computacenter.de:8081 Via: 1.0 dezntpx01.computacenter.de:8081 (squid/2.7.STABLE5), 1.0 dezntpx03.computacenter.de:8081 (squid/2.7.STABLE5) Connection: keep-alive Proxy-Connection: keep-alive 

那么,首先是这样的:

 ServerName mydomain.de:80 ServerAlias www.mydomain.de 

需要这样做:

 ServerName www.mydomain.de ServerAlias mydomain.de 

UseCanonicalName应该也可以打开。 如果你想保持在一个版本的网站,这是帮助你,而不是伤害你。

编辑 :好的,问题是你的Apache服务器甚至没有控制你所看到的行为; 你正在与之通话的代理是。 为什么决定抛出301redirect还不清楚,但可能是因为www.mydomain.deCNAMElogging。 我会尽量让它成为Alogging。

代理也可能花费一些时间来注意你正在做的事情,并调整它的行为。 据我所知,它也可能有实际configuration的规则,告诉它从您的域www