如何将wordpress主页重定向到drupal主页?

I have wordpress homepage with the link (exxample:http://online.com/wp) and drupal home page is (exxample:http://online.com/drup). for wordpress homepage alone i need to redirect to drup other than wordpress home page link should be work example: (http://online.com/wp/product-category/product1). i tried to use htaccess but it is not working

redirect 301 /wp/index.php http://online.com/drup

The above one redirect every link in worpdress. please advise me on this

You can redirect it via WordPress redirect.

In your theme's functions file, you can write something like this:

function homepage_redirect(){
        if( is_front_page() || is_home()  ){
            wp_redirect( 'http://online.com/drup' );
            die;
        }
    }
    add_action( 'template_redirect', 'homepage_redirect' );

WordPress uses hooks and template_redirect is called just before loading appropriate template for the page, we can call the wp_redirect function here. Also that die; as last line there is to exit the WP from further execution. Details here: https://developer.wordpress.org/reference/functions/wp_redirect/