Nginx rewrite makes me crazy

39 Views Asked by At

the URL is: http://xxxxxx/index.php?route=product/category&path=565

and why the heck the rules below dont work?!?!

THIS - dont work at all:

if ($request_uri ~* "^(.*)product/category&path=565"){
    rewrite ^(.*)$ /index.php?route=product/category&path=174&filter=sale? last;
}

THIS - aint work too! =(

if ($args ~* "^(.*)product/category&path=565"){
    rewrite ^(.*)$ /index.php?route=product/category&path=174&podbor=m:feniks? last;
}
1

There are 1 best solutions below

0
On

Both of your rewrite rules work correctly (for me). The problem maybe that your application requires external redirection rather than internal redirection in order to see the change.

Consider using the redirect modifier rather than the last modifier. Of course, this will mean that the client will also see the rewritten URL.

See this document for more.