Lighttpd mod_rewrite 到 Apache Mod_rewrite

发布于 2024-07-30 20:17:58 字数 525 浏览 1 评论 0原文

我在这里寻求帮助。 我正在尝试将 lighttpd mod_rewrite 转换为 apache mod_rewrite

就是这样。 Lighttpd

    url.rewrite-once = (
"/torrent/([0-9A-F]{2,2})([0-9A-F]{2,2})([0-9A-F]{36,36}).*" => "/t3/$1/$2/$3.torrent",
)

我查找了 apache 的 mod_rewrite 的多个教程,但确实没有帮助。

这是我想出的:

RewriteRule ^/torrent/ ([0-9A-F]{2,2})/ ([0-9A-F]{2,2})/ ([0-9A-F]{36,36})/* => /t3/$1/$2/$3.torrent

如果有人可以帮助我转换它,那将是一件幸事,谢谢你,

当我将其放入时,我得到的只是错误代码 500,mod_rewrite 已启用,但这不起作用。

I am looking for some help here. I am trying to convert lighttpd mod_rewrite to apache mod_rewrite

Here it is.
Lighttpd

    url.rewrite-once = (
"/torrent/([0-9A-F]{2,2})([0-9A-F]{2,2})([0-9A-F]{36,36}).*" => "/t3/$1/$2/$3.torrent",
)

I look up multiply tutorials of apache's mod_rewrite but really no help.

Here what I came up with:

RewriteRule ^/torrent/ ([0-9A-F]{2,2})/ ([0-9A-F]{2,2})/ ([0-9A-F]{36,36})/* => /t3/$1/$2/$3.torrent

If anybody can help me convert this, it would be an blessing, thankyou

all I get when I put this in is error code 500, mod_rewrite is enabled but this doesn't work.

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

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

发布评论

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

评论(1

探春 2024-08-06 20:18:04

Apache 的 mod_rewrite 语法有点不同:

RewriteRule Pattern Substitution [flags]

各部分用 1 分隔或更多空白字符,并且 [flags] 是可选的。

所以试试这个:

RewriteRule ^/torrent/([0-9A-F]{2})/([0-9A-F]{2})/([0-9A-F]{36}) /t3/$1/$2/$3.torrent

Apache’s mod_rewrite syntax is a little different:

RewriteRule Pattern Substitution [flags]

The parts are separated by one or more whitespace characters and [flags] is optional.

So try this:

RewriteRule ^/torrent/([0-9A-F]{2})/([0-9A-F]{2})/([0-9A-F]{36}) /t3/$1/$2/$3.torrent
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文