http - 从 http 重定向到 https 时,我应该使用哪个状态码?

标签 http redirect http-status-codes

HTTP 状态 302 是临时重定向的状态。我想我们可以利用这个身份来达到我的目的。我用谷歌搜索,看到有人使用 303,而不是 302。你的想法怎么样?谢谢!

最佳答案

在查找显示使用 IIS 和 URL 重写的 HTTPS 重定向的示例或教程时,您会发现 redirectType 的所有变体。 :

如果您希望客户端下次使用 HTTPS,请使用 Permanent。如果您尝试重定向一段时间后不确定是否希望它永久生效,请使用临时。

更多人在这里回答了同样的问题:https://webmasters.stackexchange.com/questions/22268/when-redirecting-from-http-to-https-in-a-shop-site-which-status-code-should-i-u

关于http - 从 http 重定向到 https 时,我应该使用哪个状态码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20405278/

相关文章:

Django:POST 方法显示重新发布警告后重定向到当前页面

php - 程序员应该关注哪些 HTTP 状态码?

http-status-code-403 - 401 未授权 vs 403 禁止 : Which is the right status code for when the user has not logged in?

linux - Eclipse+Solex 的 HTTP 记录/回放替代方案

mongodb - I/flutter (30720) : SocketException: OS Error: Connection timed out, errno = 110,地址 = 192.19.170.13,端口 = 47763

.htaccess 重定向,带参数的 URL

http-status-codes - 对于缺少的必需参数,返回的正确 HttpStatusCode 是什么?

php - HTTP header : Expires

c# - 在 .NET 的 HTTP 请求中传递数组值

将 EC2 弹性负载均衡器从 HTTP 重定向到 HTTPS