Wordpress - Redirect entire website to a single page

You can actually do this from inside WordPress itself, instead of needing to come up with a confusing and overengineered .htaccess fix.

We can hook into the template_redirect filter, which only fires on the front-end (not in wp-admin). We then use the is_page() function to check if we're viewing a page with the ID of 813. If not, redirect to that page using the wp_redirect() function.

add_action( 'template_redirect', function() {
    if ( is_page( 813 ) ) {
        return;
    }

    wp_redirect( esc_url_raw( home_url( 'index.php?page_id=183' ) ) );
    exit;
} );

This will work great for a maintenance mode, as the redirect is made with the 302 'temporary' HTTP header, letting bots and search engines know that your site will be up soon. However, if you're permanently moving the site, you might want to use a 301 'permanent' HTTP header for the redirect. You can do this by adding a second parameter to the wp_redirect function. Example:

add_action( 'template_redirect', function() {
    if ( is_page( 813 ) ) {
        return;
    }

    wp_redirect( esc_url_raw( home_url( 'index.php?page_id=183' ) ), 301 );
    exit;
} );