Я пытаюсь перенаправить некоторые ссылки со старого сайта WordPress на новый.

Мой файл .htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^press-release-mcp-and-tmr-integrate-to-seize-maritime-communications-opportunities$ http://newurl.com/news/press-release-mcp-and-tmr-integrate-to-seize-maritime-communications-opportunities [L,R=301]
RewriteRule ^press-release-bygger-verdens-storste-4g-nett-offshore$ http://newurl.com/news/press-release-bygger-verdens-storste-4g-nett-offshore [L,R=301]
RewriteRule ^press-release-33-cruise-ships-with-mobile-and-internet-services-from-mcp$ http://newurl.com/news/press-release-33-cruise-ships-with-mobile-and-internet-services-from-mcp [L,R=301]
RewriteRule ^press-release-mcp-to-install-4g-infrastructure-on-norwegian-continental-shelf-with-shell$ http://newurl.com/news/press-release-mcp-to-install-4g-infrastructure-on-norwegian-continental-shelf-with-shell [L,R=301]
RewriteRule ^press-release-returns-to-win-offshore$ http://newurl.com/news/press-release-returns-to-win-offshore [L,R=301]
RewriteRule ^can-it-be-true-that-todays-improvements-in-communication-for-the-offshore-environment-initiate-a-paradigm-shift$ http://newurl.com/news/can-it-be-true-that-todays-improvements-in-communication-for-the-offshore-environment-initiate-a-paradigm-shift [L,R=301]
RewriteRule ^how-mobile-data-roaming-increases-your-mobile-data-traffic$ http://newurl.com/news/how-mobile-data-roaming-increases-your-mobile-data-traffic [L,R=301]
RewriteRule ^why-is-improved-personalized-communication-paramount-for-the-offshore-industry$ http://newurl.com/news/why-is-improved-personalized-communication-paramount-for-the-offshore-industry [L,R=301]
RewriteRule ^why-mobile-data-will-remain-the-most-important-source-of-revenue$ http://newurl.com/news/why-mobile-data-will-remain-the-most-important-source-of-revenue [L,R=301]
RewriteRule ^color-line-extends-contract-with-mcp$ http://newurl.com/news/color-line-extends-contract-with-mcp [L,R=301]
RewriteRule ^author/mcp$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^author/andreas-lutebergetmcp-com$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^author/roar-walderhaugmcp-com$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^archives/press-releases$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^archives/news$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^archives/insights$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^need-for-offshore-speed$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^customers$ http://newurl.com/service-support [L,R=301]
RewriteRule ^about-mcp/travel-smart$ http://newurl.com/service-support [L,R=301]
RewriteRule ^about-mcp/organization$ http://newurl.com/business/about-us/the-team [L,R=301]
RewriteRule ^about-mcp/career$ http://newurl.com/business/about-us/careers [L,R=301]
RewriteRule ^about-mcp$ http://newurl.com/business/about-us [L,R=301]
RewriteRule ^cruise$ http://newurl.com/business/cruise [L,R=301]
RewriteRule ^ferry$ http://newurl.com/business/ferry [L,R=301]
RewriteRule ^fisheries$ http://newurl.com/business/fisheries [L,R=301]
RewriteRule ^solutions$ http://newurl.com [L,R=301]
RewriteRule ^offshore$ http://newurl.com/business/offshore [L,R=301]
RewriteRule ^contact-us$ http://newurl.com/business/about-us/contact [L,R=301]
RewriteRule ^history$ http://newurl.com/business/about-us/history [L,R=301]
RewriteRule ^installations-in-operation$ http://newurl.com/business/about-us/installations-in-operation [L,R=301]
RewriteRule ^mcp-insight$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^newsevents$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^protu_roaming.php$ http://newurl.com/business/about-us/installations-in-operation [L,R=301]
RewriteRule ^coverage.php$ http://newurl.com/business/about-us/installations-in-operation [L,R=301]
RewriteRule ^press-kit$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule (.*) http://newurl.com [L,R=301]

Некоторые старые ссылки корректно перенаправляются на новые, как указано в правиле (cruise, about-mcp, history), но другие просто соответствуют последнему правилу (первые 16 правил; из «press-release-mcp-and-tmr». .. "к" архивам / взглядам ").

Каждый тестер htaccess, который я пробовал, говорил, что правила в порядке (http://htaccess.mwl.be/, http://martinmelin.se/rewrite-rule-tester/), но когда я пытаюсь использовать браузер или curl, они нет.

Любая идея, как я могу это исправить?

ОБНОВИТЬ

Те, которые работают:

RewriteRule ^need-for-offshore-speed$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^customers$ http://newurl.com/service-support [L,R=301]
RewriteRule ^about-mcp/travel-smart$ http://newurl.com/service-support [L,R=301]
RewriteRule ^about-mcp/organization$ http://newurl.com/business/about-us/the-team [L,R=301]
RewriteRule ^about-mcp/career$ http://newurl.com/business/about-us/careers [L,R=301]
RewriteRule ^about-mcp$ http://newurl.com/business/about-us [L,R=301]
RewriteRule ^cruise$ http://newurl.com/business/cruise [L,R=301]
RewriteRule ^ferry$ http://newurl.com/business/ferry [L,R=301]
RewriteRule ^fisheries$ http://newurl.com/business/fisheries [L,R=301]
RewriteRule ^solutions$ http://newurl.com [L,R=301]
RewriteRule ^offshore$ http://newurl.com/business/offshore [L,R=301]
RewriteRule ^contact-us$ http://newurl.com/business/about-us/contact [L,R=301]
RewriteRule ^history$ http://newurl.com/business/about-us/history [L,R=301]
RewriteRule ^installations-in-operation$ http://newurl.com/business/about-us/installations-in-operation [L,R=301]
RewriteRule ^mcp-insight$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^newsevents$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^protu_roaming.php$ http://newurl.com/business/about-us/installations-in-operation [L,R=301]
RewriteRule ^coverage.php$ http://newurl.com/business/about-us/installations-in-operation [L,R=301]
RewriteRule ^press-kit$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule (.*) http://newurl.com [L,R=301]

Те, которые не работают:

RewriteRule ^press-release-mcp-and-tmr-integrate-to-seize-maritime-communications-opportunities$ http://newurl.com/news/press-release-mcp-and-tmr-integrate-to-seize-maritime-communications-opportunities [L,R=301]
RewriteRule ^press-release-bygger-verdens-storste-4g-nett-offshore$ http://newurl.com/news/press-release-bygger-verdens-storste-4g-nett-offshore [L,R=301]
RewriteRule ^press-release-33-cruise-ships-with-mobile-and-internet-services-from-mcp$ http://newurl.com/news/press-release-33-cruise-ships-with-mobile-and-internet-services-from-mcp [L,R=301]
RewriteRule ^press-release-mcp-to-install-4g-infrastructure-on-norwegian-continental-shelf-with-shell$ http://newurl.com/news/press-release-mcp-to-install-4g-infrastructure-on-norwegian-continental-shelf-with-shell [L,R=301]
RewriteRule ^press-release-returns-to-win-offshore$ http://newurl.com/news/press-release-returns-to-win-offshore [L,R=301]
RewriteRule ^can-it-be-true-that-todays-improvements-in-communication-for-the-offshore-environment-initiate-a-paradigm-shift$ http://newurl.com/news/can-it-be-true-that-todays-improvements-in-communication-for-the-offshore-environment-initiate-a-paradigm-shift [L,R=301]
RewriteRule ^how-mobile-data-roaming-increases-your-mobile-data-traffic$ http://newurl.com/news/how-mobile-data-roaming-increases-your-mobile-data-traffic [L,R=301]
RewriteRule ^why-is-improved-personalized-communication-paramount-for-the-offshore-industry$ http://newurl.com/news/why-is-improved-personalized-communication-paramount-for-the-offshore-industry [L,R=301]
RewriteRule ^why-mobile-data-will-remain-the-most-important-source-of-revenue$ http://newurl.com/news/why-mobile-data-will-remain-the-most-important-source-of-revenue [L,R=301]
RewriteRule ^color-line-extends-contract-with-mcp$ http://newurl.com/news/color-line-extends-contract-with-mcp [L,R=301]
RewriteRule ^author/mcp$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^author/andreas-lutebergetmcp-com$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^author/roar-walderhaugmcp-com$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^archives/press-releases$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^archives/news$ http://newurl.com/business/about-us/news-events [L,R=301]
RewriteRule ^archives/insights$ http://newurl.com/business/about-us/news-events [L,R=301]

1 ответ1

-1

Одна из причин проблемы может заключаться в следующем : постоянное перенаправление кэшируется браузерами (а в частном режиме это не помогает в случае Google Chrome).

Еще одна вещь, которую я обнаружил (имея преимущество в знании как исходного URL-адреса, так и нового), заключается в том, что в Firefox (в приватном режиме) старый URL-адрес больше не перенаправляется (плохо), а просто выдает 404 (потому что плохие перенаправления были удалены из файла .htaccess). Это заставляет меня думать о проблеме как о кеширующей, даже более.

Это мои выводы, и я не думаю, что проблема должна рассматриваться с другой точки зрения, поскольку для свежих систем поведение не такое, как в тестируемых средах.

Я был бы честно рад видеть лучший ответ, чем этот, если таковой будет вообще :)

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .