Facing issue with nginx url rewrite rules. What I want is to serve http://example.com/2015/03/23/post-title/ page when someone tries to access http://example.com/2015/03/23/myfeed/post-title/ url. And it should return 200 status. I tried below rewrite rule which works fine when wordpress permalink is set to default but as soon as I set permalink to custom below rules does not works.
location ~ ^(.*)/myfeed(.*) {
rewrite ^(.*)/myfeed(.*)$ $1$2 last;
}
Other rule in my nginx conf file is,
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
I guess my rule is conflicting with the WordPress custom permalink rule. Can anyone please help with this?