Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A weird request, but I really need this answered. Can you guys help me using re-write rules to remove the trailing slash from urls in Lighttpd.conf?



I want url A to be forced into the semantics of url B.

Thank you very much.

share|improve this question

What you are trying to do sounds wrong. The web-server does not handle the request urls that the browser sees. This is an application issue. Your web-application needs to present the urls in the form of instead of that it does now.

If you do not want to change the application but still want this desired behaviour, you may want to consider using a filtering proxy in front of lighty and then filtering all the returned links.

share|improve this answer

Not really to the point, but you might want to have the reverse effect...

Anyways, as far as lighttpd code goes, that would be something like this:

url.redirect = ( "/page/" => "/page" )
url.rewrite-once = ( "/page" => "/page/" )

but, since "/page" doesn't find a file and tries the directory "/page/" (and the rewrite seems to do nothing to hide that), that does produce a redirect-loop.

Then your real question would be: is it possible to tell lighttpd not to redirect on directories? That, unfortunately, I didn't find a way to do... but I didn't search in deep, in fact I do prefer URLs with trailing slashes (also visually)...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.