Reputation: 3
i created custom post type with custom taxonemy , i added the following function to rewrite link but it not working
add_action('template_redirect', 'redirect_old_office_url');
function redirect_old_office_url() {
// Check if the current page is the old URL
if (is_page('en/office-furniture/cabinets-en')) {
// Redirect to the new URL
wp_redirect(home_url('en/office/cabinets-en/'), 301);
exit;
}
}
and i tried to rewrite from htaccess but not working too any one can help
Upvotes: 0
Views: 25