重写规则 - 但仅限于某个 url

发布于 2024-09-29 21:38:22 字数 340 浏览 1 评论 0原文

我的 htacces 中有一个重写规则,它重写 POST http 授权请求并将其转换为 get 请求。但这发生在每个 http auth 请求上。

实际上,我只需要它在访问 www.mysite.com/googlecheckout/api url 时进行重写:

这就是我目前拥有的:

RewriteCond %{HTTP:Authorization} .*
RewriteRule index.php index.php?login=%{HTTP:Authorization}

这确实有效,但它弄乱了其他地方的其他几个页面。

有人知道如何实现这一目标吗?
非常感谢

I have a rewrite rule in my htacces that rewrites POST http authorization requests and converts it in to a get request. But this happens to every http auth request.

I actually only need it to rewrite if it is going to the www.mysite.com/googlecheckout/api url:

This is what I currently have:

RewriteCond %{HTTP:Authorization} .*
RewriteRule index.php index.php?login=%{HTTP:Authorization}

This does work but it messes up a couple of other pages elsewhere.

Any one know how to achieve this?
Many thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情仇皆在手 2024-10-06 21:38:22

试试这个规则:

RewriteCond %{REQUEST_METHOD} =POST
RewriteCond %{HTTP:Authorization} .+
RewriteRule ^googlecheckout/api$ index.php?login=%{HTTP:Authorization}

Try this rule:

RewriteCond %{REQUEST_METHOD} =POST
RewriteCond %{HTTP:Authorization} .+
RewriteRule ^googlecheckout/api$ index.php?login=%{HTTP:Authorization}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文