且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

htaccess重写条件在Internet Explorer中不起作用

更新时间:2023-10-17 17:53:58

Internet Explorer不太可能发送除Chrome和Firefox之外的另一个 host 标头.您可能看到的是Internet Explorer缓存了一个错误的旧重写规则(您使用的是 301 永久重定向,它们被缓存在浏览器中).可能还有Chrome和Firefox缓存了一个旧规则.

It's unlikely that Internet Explorer sends another host header than Chrome and Firefox. Probably what you're seeing is that Internet Explorer has an old and wrong rewrite rule cached (you're using 301 permanent redirects, they get cached in the browser). It could also be that Chrome and Firefox have an old rule cached.

清除浏览器缓存或使用私有/隐身模式,然后重试.

Clear your browser cache or use private/incognito mode and then try again.

我建议您使用 302 临时重定向,直到您确认所有规则均正常运行.

I can recommend using 302 temporary redirects until you have verified that all rules are working properly.

如果以上内容确实可以帮助您解决问题,则:

If the above does help you solve your issue:

您可以在此处测试重写规则: http://htaccess.madewithlove.be

You can test your rewrite rules here: http://htaccess.madewithlove.be

您可以通过按 F12 /联网视图在Internet Explorer的开发人员控制台中查看请求标头,包括 Host 标头.

You can view the request headers, including the Host header, in Internet Explorer's developer console by pressing F12 / networking view.

还要检查Internet Explorer和调制解调器/路由器的设置,以确认您不是意外使用了代理.

Also check Internet Explorer's and modem/router settings to verify that you're not accidentally using a proxy.