1

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
        }
Paul
  • 3,037
  • 6
  • 27
  • 40
ffuentes
  • 111
  • 2
  • Did you resolve this? I am also learning `httpd` and if I understand, the `request rewrite` is for when you want something internally different from the external request. However, if you are changing to a new configuration internally and externally, but want to retain the old external links, you would use `block return`. – Paul Jul 01 '21 at 17:30
  • Sorry, no, I just installed nginx because I didn't find info at the time (this is a question from 2020). So you're saying the rewrite rule is backwards? – ffuentes Jul 01 '21 at 17:40
  • I'm not sure why your configuration doesn't work (yet but hopefully will learn), I'm just saying that I couldn't tell if it is the tool for your job, as it kind of looks like you might be better off using `block return`. IOW, if I understand correctly, `request rewrite` is when you want users requesting a URL to get some other location in the server. They seem similar, but are different. See the man page, though I know is a bit terse. – Paul Jul 01 '21 at 17:44

0 Answers0