I need a function(s) where I load to 1 specific page (index.php?p=49) whenever a URL is written with an all numeric slug/end. However, the written URL has to remain the same in the browser as it loads the specific page. I currently have an add_rewrite_rule function that brings any all numeric url-slugs to the page "nummer".
The problem is the URL link in the browser changes too, I have yet to find an answer to keep it the same but load a different page.
Rewrite rule function:
add_action('init', function(){
add_rewrite_rule( '([0-9]+)[/]?$', 'index.php?p=49', 'top' );
});
But instead of a browser URL like localhost/callerid/wordpress/0 changing to localhost/callerid/wordpress/nummer it has to stay localhost/callerid/wordpress/0, but load the page of localhost/callerid/wordpress/nummer (index.php?p=49)