How Add Custom Redirection for Specific WP Page

How Add Custom Redirection for Specific WP Page

/**
 * Custom Redirection Function for /online-keuzehulp/.
 */
function redirect_online_keuzehulp() {
    if( is_page( 13024 ) && count($_GET) ){
        $mylink = $_SERVER['REQUEST_URI'];
        $mylink = str_replace( '/online-keuzehulp/', '/assortiment/', $mylink );
        $url = home_url().$mylink;
        wp_safe_redirect( $url );
    }
}
add_action('wp_head', 'redirect_online_keuzehulp');
wprocket

 

GenesisPro728x90

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Share on tumblr
Tumblr
Anwer Ashif

Anwer Ashif

Founder of RainaStudio. Help businesses and individuals to create and outstand their online presence. Our success rate is measurable. Our blog served all around the world and counting.

Leave a Reply

Your email address will not be published.

Want to speed up WordPress site?