Derek
Derek

Reputation:

Lighttpd mod_rewrite to Apache 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.

Upvotes: 1

Views: 1164

Answers (1)

Gumbo
Gumbo

Reputation: 655795

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

Upvotes: 1

Related Questions