Remove trailing slash Lighttpd url

lighttpdrewrite

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?

EG:

**A** www.example.com/page/
**B** www.example.com/page

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

Thank you very much.

Best Answer

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 www.example.com/page instead of www.example.com/page/ 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.