简体   繁体   English

HTTPS重定向,没有$ _POST数据

[英]HTTPS redirect, no $_POST data

I have in my .htaccess 我有.htaccess

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

The pages are correctly redirected to their https// "version". 页面已正确重定向到其https //“版本”。 However, no $_POST data can be read in php. 但是,在PHP中无法读取$_POST数据。 That is, I always get an empty $_POST . 也就是说,我总是得到一个空的$_POST If I do not use RewriteRule, everything is fine. 如果我不使用RewriteRule,一切都很好。

I think I am missing something. 我想我错过了什么。

将表单的URL设置为https,这样就不必触发重定向。

Unfortunately most user-agents convert redirects on POST requests into GET requests (there is some discussion in the spec ). 不幸的是,大多数用户代理将POST请求上的重定向转换为GET请求( 规范中有一些讨论)。 It would be preferable to not rely on this 最好不要依赖于此

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

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