Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: convert rule apache to nginx

$
0
0
> RewriteCond %{REQUEST_URI} /(.+?)/pagina-(.+?)/ [NC]
> RewriteRule (.*) /%1/?page=%2 [L,QSA,NC]
итак,
[NC] - (no case) - без учёта регистра
[L] - last|L - Stop the rewriting process immediately and don't apply
any more rules. Especially note caveats for per-directory and
.htaccess context
[QSA] - qsappend|QSA - Appends any query string from the original
request URL to any query string created in the rewrite target.
[NC] - nocase|NC - Makes the pattern comparison case-insensitive

значит, должно быть как-то так:
rewrite ^(/.*)/pagina-(.*)/ $1/?page=$2&$args break;
но такая конструкция получилась чувствительной к регистру

лучше так:
location ~* ^(?<x>/.*)/pagina-(?<y>.*)/ {
rewrite ^ $x/?page=$y&$args break;
}

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>