How to redirect CPT permalinks from ID to default pretty permalinks?
If I understood you correctly, you will first need to redirect your user to http://domain.com/cpt1/%postname%/ and afterward, you’ll need to rewrite the URL in order to get the correct post and avoid 404 errors. So here you go: add_action( ‘template_redirect’, ‘redirect_postid_to_postname’ ); function redirect_postid_to_postname() { $uri = $_SERVER[‘REQUEST_URI’]; // Checks if the URI matches what … Read more