Question: How do I redirect this page URL, `http://localhost/wordpress_rnd/?page_id=2`, to the home URL, `http://localhost/wordpress_rnd/`, without using any plugins?

Answer: 
The correct way to do this is using the [`template_redirect`](https://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect) hook by adding a function to your `functions.php`:

```
function redirect_to_home() {
  if(!is_admin() && is_page('2')) {
    wp_redirect(home_url());
    exit();
  }
}
add_action('template_redirect', 'redirect_to_home');

```
Locate page.php (assuming you've created it already). After this line `<?php get_header(); ?>` add the following code:

```
<?php if(is_page('2')) {
    wp_redirect( home_url(), '302' ); 
} ?>

```

In the code above, `is_page('2')` is actually the ID of your page as you've specified in your example.