You can add this to your child theme's functions.php' file:
If you have the WooCommerce plugin installed and want to redirect the default store address to another address:
function custom_redirect_shop_page_atakanau() {
if ( is_shop() ) {
wp_redirect( 'https://domain.tld/custom-url' );
exit;
}
}
add_action( 'template_redirect', 'custom_redirect_shop_page_atakanau' );
This code redirects to the custom url when the store page is visited.
UPDATED:
The following code redirects requests to the /old-slug URL to the /new-slug URL:
function custom_redirect_url_slug_atakanau() {
if ($_SERVER['REQUEST_URI'] == '/old-slug') {
wp_redirect( '/new-slug', 301 );
exit;
}
}
add_action('init', 'custom_redirect_url_slug_atakanau');
Except those; If you're looking to run WordPress and Laravel together on the same server without URL redirection, check out this:
laravel and wordpress on the same domain(laravel in subfolder)