Welcome! Log In Create A New Profile


Apache PT flags

Posted by theUniC 
Apache PT flags
November 07, 2011 08:42AM
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]

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!!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 114
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready