公告
财富商城
积分规则
提问
发文
2019-05-15 08:01发布
Viruses.
How do I convert nginx equivalent URL rewrite for the following:
RewriteRule ^read/([0-9]+)/?$ /read/?u=$1 [QSA,L]
You can do this in two ways, with a location:
# the ?<u> assigns the capture to $u. Some older pcres need ?P<u> location ^/read/(?<u>[0-9]+)/?$ { rewrite ^ /read/?u=$u last; }
or with just a rewrite:
rewrite ^/read/([0-9]+)/?$ /read/?u=$1 last;
nginx will append the query string by default (you can disable the behavior by adding another ? at the end of the rewrite target).
Give the following a try:
rewrite ^read/([0-9]+)/$ /read/?u=$1 permanent;
IfIsEvil - hence direct rewrite option.
最多设置5个标签!
You can do this in two ways, with a location:
or with just a rewrite:
nginx will append the query string by default (you can disable the behavior by adding another ? at the end of the rewrite target).
Give the following a try:
IfIsEvil - hence direct rewrite option.