Rewrite Rule for WordPress permalink in NGINX


Old permalink: https://wbxpress.net/2011/03/a-long-post-url.html

New permalink: https://wbxpress.net/a-long-post-url/

Add the following into the virtual host configuration file.

rewrite "/([0-9]{4})/([0-9]{2})/(.*).html" https://wbxpress.net/$3 permanent;
,

Leave a Reply

Your email address will not be published.