If I use the simple code below:
function my_custom_rewrite_rules() {
add_rewrite_rule(
'^rewriteme$',
'index.php?page_id=1',
'top'
);
}
add_action('init', 'my_custom_rewrite_rules');
I would expect to be able to visit http://example.com/rewriteme
and see the content of the Hello World post while keeping /rewriteme
in the address bar. It doesn’t work, though. It actually redirects to http://example.com/hello-world/
.
How do I get it to display the content of the Hello World post without actually changing the URL in the address bar?
(And yes, I’ve flushed rewrite rules.)