我从索引表单
到达此页面的index.php
<form action = 'upload' method = 'post' name = 'former' id = 'former'>
如果我执行.htaccess名称重写,upload.php无法找到已发布表单中的值
将此项放在.htaccess中会使uplaod.php无法读取已发布的值:
RewriteCond %{THE_REQUEST} /upload\s [NC]
RewriteRule . UploadStampLibanPost/ [R=301,L]
RewriteRule ^UploadStampLibanPost/$ upload.php [L]
应删除此.htaccess行,以便表单能够阅读
name = 'typ' value = 'value1'
http://www.us-traders.com/
非常感谢
答案 0 :(得分:0)
忽略来自外部重定向的POST
请求,因为重定向不会将POST数据传送到新网址:
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{THE_REQUEST} /upload\s [NC]
RewriteRule . UploadStampLibanPost/ [R=301,L]
RewriteRule ^UploadStampLibanPost/$ upload.php [L]
答案 1 :(得分:0)
在 301永久移动上不会传输POST数据,因此您需要将表单直接发布到upload.php,或者将.htaccess更改为不发出301. < / p>