在 htaccess 文件中使用 RewriteMap

发布于 2024-09-28 09:46:26 字数 150 浏览 2 评论 0原文

如何在 htaccess 文件中使用 RewriteMap 指令? 当我把它放在那里时,我收到“此处不允许 RewriteMap”错误。

我知道当将其放入 httpd.conf 或虚拟主机配置文件中时,此错误将会消失。 但我想知道是否可以将其放入 htaccess 中?

How can i use RewriteMap directive in htaccess file?
When i put it there i get "RewriteMap not allowed here" error.

I know this error will disappear when put it in httpd.conf or virtualhost configuration file.
But i want to know is it possible to put it in htaccess or not?

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

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

发布评论

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

评论(3

猫卆 2024-10-05 09:46:26

来自文档

上下文:服务器配置、虚拟主机

所以恐怕答案是“否”。

From the documentation:

Context: server config, virtual host

so the answer is "no", I'm afraid.

小镇女孩 2024-10-05 09:46:26

据我所知它不能在 htaccess 中使用。

也许您可以将其作为替代方案: http://savride.wordpress.com/2008/09/09/rewritemap-directive-in-htaccess-file-problem/

As far as I know it cannot be used in htaccess.

Maybe you could check this out as an alternative: http://savride.wordpress.com/2008/09/09/rewritemap-directive-in-htaccess-file-problem/

脱离于你 2024-10-05 09:46:26

正如你所说,你可以在 VirtualHost 中声明 RewriteMap,但是一旦声明你就可以在 .htaccess 中使用它,我已经像 Apache 2.4 中那样使用它了

As you say you can declare RewriteMap in VirtualHost, but once declared you can use it in .htaccess, I have used it like that in Apache 2.4

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文