Hi all,
I would want to know if there is a way to emulate the [PT] flag of the Apache's mod_rewrite. I have an application realying heavily on these feature and I'm not able to find a way to apply the same behaviour with nginx.
Here it is the mod_rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^[a-z0-9-+_]+-tematica-([0-9]+).htm$ /web/search/tematica?idCategoria=$1&%{QUERY_STRING} [PT]
RewriteRule ^[a-z0-9-+_]+-tematica-([0-9]+)_([0-9]+).htm$ /web/search/tematica?idCategoria=$1&p=$2&%{QUERY_STRING} [PT]
# Entry point rule
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
And here it is my actual nginx configuration file
...
location / {
try_files $uri $uri/ @rewrites;
}
location @rewrites {
rewrite ^/[a-z0-9-+_]+-tematica-([0-9]+).htm$ /web/search/tematica?idCategoria=$1 last;
rewrite ^/[a-z0-9-+_]+-tematica-([0-9]+)_([0-9]+).htm$ /web/search/tematica?idCategoria=$1&p=$2 last;
rewrite ^.*$ index.php break;
}
...
Thanks in advance!!
Greetings,
Christian.