It seems like the curly braces aren’t working. I’ve tried the following
without results:
location ~* /manufacturers/ {
rewrite "^/manufacturers/(.{1})/(.*)$"
/manufacturer/directory/$1
redirect;
}
location ~* /manufacturers/ {
rewrite "^/manufacturers/([a-z] {1})/(.*)$"
/manufacturer/directory/$1 redirect;
}
location ~* /manufacturers/ {
rewrite "^/manufacturers/([a-z]?)/(.*)$"
/manufacturer/directory/$1
redirect;
}
I am new to regex, so maybe this is something simple. What I want to get
is
the first letter of first captured word. What I can do is pull the
entire
word with (.*), but not the first letter only.
Any help would be appreciated.
Thanks in advance.
Using nginx 0.8.53 reverse proxy in front of apache
/([a-z] ?)/
This one will match and capture one letter optionally followed by space between
slashes
Examples:
/a/ -> $1: a
/a / -> $1: "a "
/asd/ -> no match