dongqiu3254 2015-05-02 18:47
浏览 237

htaccess不需要301重定向和POST数据丢失

I have an MVC PHP application and in xampp works great, but in linux hosting is not working properly and when it comes to send POST data via form the htaccess (without any order) gives a 301 redirect and the POST data is lost forever...

here is my htaccess:

Options -MultiViews
RewriteEngine On

RewriteBase /devel

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l


RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

With browser i can see that there is a 301 for post data and 200 (ok) for get data...

please anyone knowr why i have this 301 redirect before the normal redirect? In my script there is no header() function (not in the form nor in the destination page of course) and my hosting (Aruba.it) doens't have the mod_proxy enabled, so i can't use P flag for POST redirecting...

Ah i tried also

RewriteCond %{REQUEST_METHOD} !POST

but without any result.

Tank for any reply!!!

  • 写回答

1条回答 默认 最新

  • doucheng3811 2015-05-03 15:16
    关注

    SOLVED

    It came out it was a server redirect: i had a global var that contain the domain url "domain.com" to avoid writing it in my entire script. When it comes to call urls, the server auto rewrites "domain.com" in "www.domain.com" with a 301 http message. I changed the value of the var and everything works fine now!!!

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?