本文介绍了WampServer& XAMPPserver自动将http重定向到https(我不想这样)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我新安装的WampServer 3.1.0 64位中的每个 http 站点都会自动重定向简单的 index.html 文件没有 .htaccess 到 https 版本的网站。Every http site in my newly installed WampServer 3.1.0 64-bit is automatically redirecting simple index.html files with no .htaccess to the https version of the site.我在 C:\ wamp64 \过或 .htaccess 文件$ c> C:\ wamp64 \\\\ example 。I can see no .htaccess file in C:\wamp64\www or C:\wamp64\www\example.如果我卸载WampServer并安装XAMPPserver,会发生同样的事情。If I uninstall WampServer, and install XAMPPserver, the same thing occurs.帮助赞赏。 httpd-vhosts.conf: <VirtualHost www.superiorit.dev:80> ServerAdmin [email protected] DocumentRoot "C:/xampp/htdocs/superiorit" ServerName www.superiorit.dev ErrorLog "logs/dummy-host2.example.com-error.log" CustomLog "logs/dummy-host2.example.com-access.log" common</VirtualHost> httpd-ssl.conf:是标准默认文件。我对 httpd.conf 所做的唯一更改是:The only change I have made to httpd.conf is:Listen 172.18.1.106:80我注意到Windows任务栏中的Chrome图标与普通的Chrome图标不同: I noticed the Chrome icon in the Windows task bar looks different to the normal Chrome icon: 如果我在Edge中加载站点,不会发生重定向。If I load the site in Edge, the redirection does not occur.推荐答案在虚拟主机定义中,您还需要告诉Apache它是允许的访问保存站点代码的目录,即<目录> Within a Virtual Host definition you also need tell Apache it is allowed to access the directories that hold the site code i.e. a <Directory>我最近也了解到Google拥有 .dev tLD因此您应该考虑使用其他内容,特别是如果您使用Chrome浏览器,因为Google可以添加任何内容在那里拿起 .dev 的使用,以及做任何事情。 I also learned recently that Google owns the .dev tLD so you should consider using something else instead, specially if you are using Chrome browser as google could add anything in there to pick up the use of .dev and, well, do anything. 我知道从V63开始Chrome确实强制重定向 .dev 这也将发生在FF和其他浏览器上 This will also be happening to FF and other browsers您也不需要在< VirtualHost www.superiorit.dev:80> 行中指定域名。 * 没问题。You also dont need to specify the domain name on the <VirtualHost www.superiorit.dev:80> line. The * is fine.所以试试看看情况有所改善。So try this an see if things improve.<VirtualHost *:80> ServerName superiorit.local ServerAlias www.superiorit.local DocumentRoot C:/xampp/htdocs/superiorit <Directory "C:/xampp/htdocs/superiorit/"> Options Indexes FollowSymLinks MultiViews AllowOverride All Require local </Directory> ErrorLog "logs/superiorit.local-error.log" CustomLog "logs/superiorit.local-access.log" common</VirtualHost> 还可以查看为什么所有* .dev域都定位到我的本地主机? AND https://tech.slashdot.org/story/17/09/18/192227/chrome-to-force-domains-ending-with-dev- and-foo-to-https-via-preloaded-hsts 这篇关于WampServer& XAMPPserver自动将http重定向到https(我不想这样)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-29 06:54