products-cat.php?id=$1 [L,QSA]
RewriteRule ^/?products/([^/]+)/([^/]+)/?$ product-detail.php?id=$1 [L,QSA]
https://httpd.apache.org/docs/2.0/ko/mod/mod_rewrite.html#rewriterule —> meaning of those L, QSA directives https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite —> rewrite syntax of nginx https://regex101.com/ —> handy regex emulator for testing
That's badly written regexps. In nginx notation it should be something like this: rewrite "^/products/([^/]+)/?$" /products-cat.php?id=$1 last; rewrite "^/products/([^/]+)/([^/]+)/?$" /product-detail.php?id=$1 last; Mind the RewriteBase.
Обсуждают сегодня