仅在GET上进行mod_rewrite [英] mod_rewrite only on GET

查看:76
本文介绍了仅在GET上进行mod_rewrite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个远景,但是我希望找到一个奇怪的错误的简单解决方法,该错误仅在应用程序省略/推断查询字符串时才会出现.

It's a longshot, but I'm hoping to find a simple workaround for a bizarre bug that only manifests when the query string is omitted/inferred by the application.

在深入研究一千行最小化的第三方JavaScript之前,我想了解一下是否可以使用mod_rewrite自动应用查询字符串.

Before I dig deep into a thousand lines of minified 3rd party javascript, I'd like to find out if I can just auto apply the querystring using mod_rewrite.

RewriteRule    ^index\.php$  index.php?module=Home&action=index

现在,这可以正常工作,除非有时所有数据都将被发布,所以我需要一个RewriteCond,因此该规则仅在GET请求而不是POST请求上触发.

Now, this would work fine except sometimes all the data will be POSTed so I need a RewriteCond so the rule will only fire on GET requests, and not POST requests.

这可能吗?

推荐答案

添加此条件...

RewriteCond %{REQUEST_METHOD} !POST

...不匹配POST请求.

这篇关于仅在GET上进行mod_rewrite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆