Как сделать синоним URL страницы в WordPress без редиректа?

Для трёх алиасов (info-list.html, info-work.html, info-home.html), которые будут показывать содержимое одной и той же страницы (например, с ID = 49164) без редиректа:

// Добавляем алиасы для страницы с ID 49164
add_action('init', 'add_custom_page_aliases');
function add_custom_page_aliases() {
    add_rewrite_rule('^info-list\.html$',    'index.php?page_id=49164', 'top');
    add_rewrite_rule('^info-work\.html$',    'index.php?page_id=49164', 'top');
    add_rewrite_rule('^info-home\.html$',    'index.php?page_id=49164', 'top');
}
// 2. Обновите постоянные ссылки после добавления!

 

В Robots.txt обязательно закрываем:

Disallow: /info-work.html
Disallow: /info-list.html
Disallow: /info-home.html
guest
Закрыть меню
ZAPLATA.RU | Магазин готовых блогов Wordpress с автонаполнением
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.