i wrote
rewrite ^/([\w_]+)/?$ /index.php?$1
btw, i wanna except /empty.
hmm..
wanna use
/alphabet -> alphabet
/emptyABC -> emptyABC
/empty -> not match
/emp -> emp
/emptAB -> emptAB
How can I make regular expressions for these?
i wrote
rewrite ^/([\w_]+)/?$ /index.php?$1
btw, i wanna except /empty.
hmm..
wanna use
/alphabet -> alphabet
/emptyABC -> emptyABC
/empty -> not match
/emp -> emp
/emptAB -> emptAB
How can I make regular expressions for these?
Not sure if i understood correctly what you want, but i think you need something like this:
rewrite ^/(.+)$ $1;
The +
will require at least 1 character to be behind the /
. Then it takes whats behind the leading /
and redirects to it.
Your examples could also imply that you want to only capture alphanumeric characters, which would be like this:
rewrite ^/([a-zA-Z0-9]+)$ $1;