Web Hosting Talk







View Full Version : looking for Lighttpd/rewrite expert


goolex
06-12-2006, 11:12 AM
Hi

i want to do this in lighttpd with rewrite ( or any things like this ) still i dont know its possible or no becouse i was unable to find any things about this

http://domain.com/images/image.jpg ==> http://domain.com/images/image.jpg
http://domain.com/index.php ==> http://domain.com/index.php

http://domain.com/XpY.jpg
X will be folder name
and Y file name

ex : http://domain.com/123p123456.jpg ==> /home/domain/123/123456.jpg
ex : http://domain.com/410p10203040.png ==> /home/domain/410/10203040.png


please say if you have any idea

thanks

Form1
06-12-2006, 11:34 AM
Something like this should work:

url.rewrite = (
"^([^p]*)p(.*)$" => "$0/$1",
)

Take it easy,

Dave

goolex
06-12-2006, 11:49 AM
thanks but showing error :(
[root@server ~]# lighttpd -f /root/lighttpd.conf
[root@server ~]# 2006-06-12 15:43:38: (server.c.857) WARNING: unknown config-key: url.rewrite (ignored)

and what can i do that it dont rewrite .php pages and other folders like /image ?

NE-Andy
06-12-2006, 11:51 AM
did you uncommented out the mod_rewrite line in conf file? I forgot to uncomment it out once and it caused the same problems when I tried to rewrite things.

goolex
06-12-2006, 12:31 PM
yes becouse i was testing in new server and i forgot to uncomment it

now its working like this :
if entry is 415p700.jpg

$0=/415p700.jpg
$1=/415

mean = /415p700.jpg//415

and still i have problem with disabling rewrite for .php and /images and other folders :(