我有一个网站,所有请求都通过(无提示.htaccess)被无提示地重定向到index.php,然后PHP用于显示正确的页面(通过解析REQUEST_URI)。我想知道是否也可以将POST数据提交到假地址?我目前有这样的表格...<form action="/send-mail" method="post">我的.htaccess规则是# redirect mail posting to indexRewriteRule send-mail index.php?send-mail [NC,L] 我的index.php支票isset($_GET['send-mail'])工作正常。但是,这似乎删除了应该发送给它的所有POST数据。有没有办法保留帖子数据?我不想使用GET,因为它不能发送太多信息,尽管使用简单的查询表可能不会出现问题。这是我.htaccess重定向到的index.php# serve files and dirs if they exist please, otherwise send to indexRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule . index.php
3 回答
![?](http://img1.sycdn.imooc.com/545861f00001be3402200220-100-100.jpg)
阿晨1998
TA贡献2037条经验 获得超6个赞
尝试这个:
# redirect mail posting to index
RewriteRule send-mail index.php?send-mail [NC,P]
“ P”的作用类似于“ L”,因为它停止了处理规则,但它还告诉模块应将请求原封不动地传递给代理模块(意味着保留了POST数据)。
- 3 回答
- 0 关注
- 368 浏览
添加回答
举报
0/150
提交
取消