domain.com 神秘重定向到 https://www.domain.com - 可能是什么原因造成的?
我在 Centos 上使用 apache,每当我使用 domain.com 时,它都会被重定向到 https://www.domain.com
一般来说,这很好,但我们有一个服务器别名域,domain2.com,它应该保留其域名(即不添加 https//www。),但配置的某些部分正在将其重新映射到https://www.domain2.com
我已经检查了 Web 应用程序目录中的 httpd.conf 和 .htaccess,但似乎没有任何重写或重定向命令执行此操作。我还检查了 cpanel/EasyApache 使用的各种包含文件...
domain2.com 被配置为主站点的 ServerAlias。
更新: 主站点是用 CakePHP 编写的 - 我可以看到它执行“如果不是 SSL,则重定向到 https”,但仍在跟踪“www”的位置。来自其他域。
更新2: app/webroot 目录下还有另一个 .htaccess,它正在将非 www 网址重定向到 www。版本。
Apache 版本信息:
Server version: Apache/2.2.17 (Unix)
Server built: Apr 20 2011 16:37:37
Cpanel::Easy::Apache v3.2.5 rev9999
Server's Module Magic Number: 20051115:25
Server loaded: APR 1.4.2, APR-Util 1.3.10
Compiled using: APR 1.4.2, APR-Util 1.3.10
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/usr/local/apache"
-D SUEXEC_BIN="/usr/local/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
非常感谢您提供任何提示/技巧。
问候, 克里斯
I am using apache on Centos and whenever I use domain.com it gets redirected to https://www.domain.com
In general this is fine, but we have an alias domain for the server, domain2.com, which should keep its domain name (ie not add https//www.), but some part of the config is re-mapping this to https://www.domain2.com
I have checked httpd.conf and the .htaccess in the web app directory, but there dont seem to be any Rewrite or Redirect commands doing this. I have also checked the various include files cpanel/EasyApache uses...
domain2.com is configured as a ServerAlias for the main site.
UPDATE:
The main site is written with CakePHP - I can see its doing the "if not SSL, redirect to https", but still tracking down where the "www." is coming from for the other domain.
UPDATE2:
There was another .htaccess below the app/webroot directory which was doing a redirect of non-www url's to the www. version.
Apache version info:
Server version: Apache/2.2.17 (Unix)
Server built: Apr 20 2011 16:37:37
Cpanel::Easy::Apache v3.2.5 rev9999
Server's Module Magic Number: 20051115:25
Server loaded: APR 1.4.2, APR-Util 1.3.10
Compiled using: APR 1.4.2, APR-Util 1.3.10
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/usr/local/apache"
-D SUEXEC_BIN="/usr/local/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Many thanks in advance for any hints/tips.
Regards,
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
重定向可能出现在页面代码、使用的任何代理/防火墙/检查点、主机文件或您的domain.com 所在的DNS 服务器中。
HTH
伊沃·斯托伊科夫
Redirection could appear in page code, proxy/firewall/checkpoint of any is used, hosts file or DNS server where your domain.com is servered.
HTH
Ivo Stoykov