views:

382

answers:

2

Hello, 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.

A: 

You might get better results asking this on ServerFault.

ars
+1  A: 

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
Gumbo