Is there anyway I can duplicate the homepage to be used as content for the woocommerce shop page. So basically just using the same page for two URL homepage and shoppage. Support told me to use redirect canonical URL if I want to avoid creating redirects.
So we can have multiple URLs lead to the same page, to prevent any SEO demerits for duplicate content as long as the link rel=”canonical” is enabled. I tried using the below code in Wordrpress in functions.php but it won’t work. The URLs are https://lullyandrose.com.au/shop and I want to use the content of the Homepage which is https://lullyandrose.com.au/
add_filter( 'redirect_canonical', 'custom_redirect_canonical', 10, 2 );
function custom_redirect_canonical( $redirect_url, $requested_url ) {
if( $requested_url == 'https://lullyandrose.com.au/shop' ) {
return $redirect_url == '/';
}
}
2
Answers
Need no to redirect it, just follow the below given steps and you are done…
see below given screenshot
must be help if you want show home page if request page shop page