Hi,
Been searching and searching but I can't seem to figure this out.
How do I rewrite a URL containing the pipe (|) character? If I try to do it with just a plain pipe then it seems to treat it like a regex OR and match it anytime I hit a url with the text before the pipe, which is obviously not desired. I've also tried to escape the pipe in a traditional regex way, no dice. If I try with URL encoded (%7C) it doesn't match at all.
rewrite ^/some/path/with|some|parameters$ /some/other/path permanent; # => matches anytime the url starts with /some/path/with
rewrite ^/some/path/with\|some\|parameters$ /some/other/path permanent; # => matches anytime the url starts with /some/path/with
rewrite ^/some/path/with%7Csome%7Cparameters$ /some/other/path permanent; # => never matches
Seems like URLs are un-encoded before processing, so %7C will not work. But how do I properly escape the pipe to make this work?
Been searching and searching but I can't seem to figure this out.
How do I rewrite a URL containing the pipe (|) character? If I try to do it with just a plain pipe then it seems to treat it like a regex OR and match it anytime I hit a url with the text before the pipe, which is obviously not desired. I've also tried to escape the pipe in a traditional regex way, no dice. If I try with URL encoded (%7C) it doesn't match at all.
rewrite ^/some/path/with|some|parameters$ /some/other/path permanent; # => matches anytime the url starts with /some/path/with
rewrite ^/some/path/with\|some\|parameters$ /some/other/path permanent; # => matches anytime the url starts with /some/path/with
rewrite ^/some/path/with%7Csome%7Cparameters$ /some/other/path permanent; # => never matches
Seems like URLs are un-encoded before processing, so %7C will not work. But how do I properly escape the pipe to make this work?