I'm using OpenBSD and its httpd. We have a community with users and currently the url to their folder is:
example.com/users/username
However, what we want is to get
example.com/~username
This is my rewrite rule:
location match "^/users/(.*)" {
request rewrite "/~%1"
directory no index
}