首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Apache 301重定向和保留post数据

Apache 301重定向和保留post数据
EN

Stack Overflow用户
提问于 2012-11-29 23:13:43
回答 2查看 47.2K关注 0票数 36

我已经实现了搜索引擎优化网址使用Apache 301重定向到一个'redirect.cfm‘在根的网站,它处理所有网址建设和内容交付。

Post数据在301重定向期间丢失。

到目前为止找不到解决方案,已经尝试从重写中排除post方法-最坏的情况我们可以使用post方法的旧类型URL。

有什么可以做的吗?

谢谢

EN

回答 2

Stack Overflow用户

发布于 2014-02-17 13:10:55

使用307应该是exactly what you want

代码语言:javascript
复制
307 Temporary Redirect (since HTTP/1.1)
In this case, the request should be repeated with another URI; however, future requests
should still use the original URI.[2] In contrast to how 302 was historically implemented,
the request method is not allowed to be changed when reissuing the original request. For
instance, a POST request should be repeated using another POST request

Wikipedia

票数 70
EN

Stack Overflow用户

发布于 2013-06-19 20:19:43

使用301重定向进行常规URL重写不是可行的方法。这是一个性能问题(特别是对于移动设备,但在一般情况下也是如此),因为它会使页面的请求数量加倍。

考虑使用URL重写工具,如Tuckey的URLrewriteFilter或apache mod_rewrite

Ray所说的都是真的,这只是对你的一般方法的补充。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13628831

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档