如何在 apache 1.3 上模拟 apache cookie 标志进行重写

发布于 2024-08-29 01:56:25 字数 392 浏览 1 评论 0原文

我正在使用带有 mod_rewrite 的 Apache 1.3,它不支持重写的 cookie|CO 标志。下面的代码在 Apache 2.0 中工作正常

# Works fine with Apache 2.0
RewriteRule ^/$ http://www.example.com/rs/ [CO=name:value:.example.com:240:/,R=301]

有没有办法在 Apache 1.3 中做同样的事情?

我可以使用:

Header set Set-Cookie "name=value; path=/; domain=.examplle.com"

仅在重写规则匹配时添加cookie吗?

I'm using Apache 1.3 with mod_rewrite it doesn't support the cookie|CO flag for rewrites. The code bellow works fine in Apache 2.0

# Works fine with Apache 2.0
RewriteRule ^/$ http://www.example.com/rs/ [CO=name:value:.example.com:240:/,R=301]

Is there a way to do the same with Apache 1.3?

Can I use:

Header set Set-Cookie "name=value; path=/; domain=.examplle.com"

to add the cookies only when a rewrite rule match?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文