My Server configuration is:
- Nginx
- php-fpm5
I set up WordPress and it's working fine with custom permalink 'Day and name'. Now I want to set the rewrite rule in the nginx file and it's not working with a clean URL. If I set the permalinks to 'default' the rule works fine.
Also I disable the default WordPress 301 redirection from adding filter for 'redirect_canonical'.
Suppose my post URL is example.com/2015/03/22/abc-test
and I want to write a rule so that if I enter example.com/2015/03/22/custom/abc-test
in browser then it should display the content of example.com/2015/03/22/abc-test
Nginx Rule:
location ~* ^(.*)/custom(.*)$ {
rewrite ^(.*)/custom(.*)$ $1$2 last;
}
I need assistance finding out how Nginx rewrite rules work with WordPress permalink.