简体   繁体   English

禁用SSL / https重定向apache2

[英]Disable ssl/https redirection apache2

I recently enabled ssl in apache2 and everything was going well, but now everytime I try to access http://example.com/ I get redirected to https://example.com/ 我最近在apache2中启用了ssl,并且一切进展顺利,但是现在每次我尝试访问http://example.com/时,我都会重定向到https://example.com/

I checked my default.conf, apache2.conf for some directions but didn't find any. 我检查了default.conf,apache2.conf的某些说明,但没有找到任何说明。

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.de
DocumentRoot /var/www
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost> <VirtualHost *:443> DocumentRoot /var/www ServerName example.com SSLEngine on SSLCertificateFile /root/server.crt SSLCertificateKeyFile /root/server.key </VirtualHost>

I also double checked the .htaccess files in all directorys. 我还仔细检查了所有目录中的.htaccess文件。 Is there a way to look up from where or what is redirecting? 有没有一种方法可以从哪里重定向? Are any other ways to redirect ALL http requests to https? 还有其他将所有http请求重定向到https的方法吗?

Open Chrome Developer Tools, go to the network tab, click on preserve log, and load your site over http. 打开Chrome开发者工具,转到网络标签,点击保留日志,然后通过http加载您的网站。

If you see a 301 or 302 redirect to https then something on the server is telling your browser to go to https. 如果您看到301或302重定向到https,则服务器上的某些内容告诉您的浏览器转到https。

If you see a 307 redirect to gyros then the site has, or had, a Strict-Transport-Security (aka HSTS) header set on it to force https and Chrome has cached that policy. 如果您看到307重定向到陀螺仪,则表明该站点已经或已经设置了严格传输安全(aka HSTS)标头来强制执行https,而Chrome已缓存了该策略。 This is a security feature web servers can use to enforce https. 这是Web服务器可以用来实施https的安全功能。 Check the HTTP Headers returned to see if that's the case and, if no such header is being sent than you can view and clear an old policy by using this page into your address bar: chrome://net-internals/#hsts 检查返回的HTTP标头是否是这种情况,如果没有发送此标头,则可以通过在地址栏中使用以下页面来查看和清除旧策略:chrome:// net-internals /#hsts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM