rewrite url path javascript code example
Example 1: javascript change url without reload
window.history.pushState('', 'New Page Title', '/new-url.php');
Example 2: cpt url rewrite
'rewrite' => array('slug' => 'projects','with_front' => false),
window.history.pushState('', 'New Page Title', '/new-url.php');
'rewrite' => array('slug' => 'projects','with_front' => false),