Amit
Amit

Reputation: 35

rewrite / redirect url in lighttpd (add a trailing slash )

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.

Upvotes: 0

Views: 1676

Answers (2)

tike
tike

Reputation: 548

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.

Upvotes: 0

Ansari
Ansari

Reputation: 8218

How about just

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

?

Upvotes: 1

Related Questions