Reputation: 2425
Suppose the value of $request_uri is /a/b/c . The current value of $uri is /index.php . Is this possible to change my $uri to /b/c .
I have tried this, which doesn't seem to be working,
if ($request_uri ~* /a/(.*)/(.*)){
set $uri /$1/$2;
}
But this gives error of duplicate "uri" variable. I also tried,
if ($request_uri ~* /a/(.*)/(.*)){
rewrite ^ /$1/$2 break;
}
But $variables don't seem to store values.
Is there a way out? Thanks.
Upvotes: 4
Views: 2480