0

I need to add a trailing slash (/) to urls in lighttpd. I tested this :

url.redirect               = ( "^(.*)$" => "$1/")

but this adds a lot of slashes at the end. Any help would be highly appreciated.

0xC0000022L
  • 20,597
  • 9
  • 86
  • 152
Amit
  • 35
  • 5
  • 1
    As far as I can tell that should only add one slash to the end as you want. Can you give an example of an input, the wrong output this expression gives and a suggestion of what the correct output should be? – Jarmex May 12 '12 at 23:37

2 Answers2

1

How about just

"^(.*[^/])$" => "$1/"

?

Ansari
  • 8,168
  • 2
  • 23
  • 34
0

Ya, as Ansari said, you would need something like this.

(Currently, I was doing the same...)

$SERVER["socket"] == "xxx.xxx.xxx.xxx:xx" { url.redirect = ("^(.*[^/])$" => "$1/") }

This would put / in the end of URL.

tike
  • 548
  • 3
  • 12
  • 22