• Apache »
  • apache rewriteRule removing the querystring in Apache < 2.4

apache rewriteRule removing the querystring in Apache < 2.4

apache rewriteRule removing the querystring in Apache < 2.4

Why?

eg: http://www.58share.com?query=jerry

301 redirect to: http://58share.com/jerry

在301跳转后会自动添加Query String到新跳转的地址: eg: http://58share.com/jerry?query=jerry

How?

1. apache >= 2.4

apache2.4 已经添加了 [QSD]这样一个标志位来解决这个问题

2. apache < 2.4

解决方案: 在跳转规则中尾部添加 ‘?’ 用来标示该跳转不需要将Query String 添加进去

Reference

http://www.marceldoorn.nl/en/blog/2012/august/server/rewriterule-removing-querystring-apache-24

This entry was posted in Apache

Leave a Reply

电子邮件地址不会被公开。

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">