ErrorDocument 404 /404.html
Options -MultiViews

RewriteEngine On

#####################################################################
# Permanently redirect all page URLs to /ansible/[page].html
# except for page names listed in parentheses
#####################################################################

RedirectMatch permanent "^/((?!index|404|automation.*|ansible_community|collections|community|core.*|galaxy|lint|ecosystem|users|developers|maintainers|platform|ansible-prior*)[^/]+)\.html" "/ansible/$1.html"

#####################################################################
# This section replaces rules defined for older versions that
# redirect plugin and module pages to collections. This section
# also consolidates specific redirects that were defined in multiple
# .htaccess configuration files.
#####################################################################

# Redirect plugin pages for versions 2.3 and 2.4
RedirectMatch permanent "^/ansible/(2\.[3-4])/plugins/(.+)\.html$" "/collections.html"

# Redirect module pages for versions 2.3 and 2.4
RedirectMatch permanent "^/ansible/(2\.[3-4])/([^\.]+)_module\.html$" "/collections.html"

# Redirect plugin and module pages for versions 2.5 to 2.8
RedirectMatch permanent "^/ansible/(2\.[5-8])/(plugins|modules)/(.+)\.html$" "/collections.html"

# Vault redirects (2.3, 2.4, 2.5, 2.6)
RedirectMatch permanent "^/ansible/(2\.(5|6))/user_guide/playbooks_vault.html" "/ansible/latest/vault_guide/index.html"
RedirectMatch permanent "^/ansible/(2\.[3-4])/playbooks_vault.html" "/ansible/latest/vault_guide/index.html"

# 2.3 and 2.4 specific redirects
RedirectMatch permanent "^/ansible/(2\.[3-4])/playbooks_roles.html" "/ansible/latest/playbook_guide/playbooks_reuse.html"
RedirectMatch permanent "^/ansible/(2\.[3-4])/playbooks_directives.html" "/ansible/latest/reference_appendices/playbooks_keywords.html"
RedirectMatch permanent "^/ansible/(2\.[3-4])/dev_guide/developing_test_pr.html" "/ansible/latest/dev_guide/testing.html"

# 2.6 specific redirects
RedirectMatch permanent "^/ansible/2.6/user_guide/quickstart.html" "/ansible/latest/getting_started/index.html"
RedirectMatch permanent "^/ansible/2.6/vmware/index.html" "/ansible/latest/collections/community/vmware/index.html"

# 2.3 to 2.7 catch all redirects
RedirectMatch permanent "^/ansible/(2\.[3-7])/(.+)\.html$" "/ansible/latest/$2.html"

#####################################################################
# Redirects for top-level project pages
#####################################################################

# Redirect the lint and galaxy pages to the ecosystem page

RedirectMatch permanent "/galaxy.html" "/ecosystem.html"
RedirectMatch permanent "/lint.html" "/ecosystem.html"

# Redirect the automation page to the platform page

RedirectMatch permanent "/automation.html" "/platform.html"

# Redirect all ansible-lint pages to ReadTheDocs

RedirectMatch permanent "^/ansible-lint/*" "https://ansible.readthedocs.io/projects/lint/"

# Redirect so docs.ansible.com/ansible-core/ and docs.ansible.com/ansible/ dont show an Index of page anymore

RedirectMatch permanent "^/ansible-core(|/|/index.html)$" "/ansible-core/devel/"
RedirectMatch permanent "^/ansible(|/|/index.html)$" "/ansible/latest/"

#####################################################################
# Redirects for pages that have moved
#####################################################################

# Redirect developer docs to new dir

RedirectMatch permanent "^/ansible/(developing_[^/]+)\.html" "/ansible/latest/dev_guide/$1.html"
RedirectMatch permanent "^/ansible/developing.html" "/ansible/dev_guide/index.html"
RedirectMatch permanent "^/ansible/dev_guide(\/)?" "/ansible/latest/dev_guide/index.html"

# Redirect from PR #79562
RedirectMatch permanent "^/ansible/(devel|latest)/dev_guide/testing_compile.html" "/ansible/$1/dev_guide/testing/sanity/compile.html"

# Redirects for renamed module reference directory

RedirectMatch permanent "^/ansible/devel/module_docs/?(.+)?" "/ansible/devel/modules/$1"
RedirectMatch permanent "^/ansible/latest/module_docs/?(.+)?" "/ansible/latest/modules/$1"

RedirectMatch permanent "^/ansible/modules_by_category.html" "/ansible/latest/module_plugin_guide/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/modules_by_category.html" "/ansible/$1/module_plugin_guide/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/modules/modules_by_category.html" "/ansible/$1/module_plugin_guide/index.html"

RedirectMatch permanent "^/ansible/modules.html" "/ansible/latest/module_plugin_guide/index.html"
RedirectMatch permanent "/ansible/latest/modules.html" "/ansible/latest/module_plugin_guide/index.html"

# Redirects for moved community page

RedirectMatch permanent "^/ansible/community.html" "/ansible/latest/community.html"
RedirectMatch permanent "^/ansible/(devel|latest)/community.html" "/ansible/$1/community/index.html"

# Redirects for refactored Ansible core docs

# CLI

RedirectMatch permanent "^/ansible/(devel|latest)/ansible.html" "/ansible/$1/cli/ansible.html"
RedirectMatch permanent "^/ansible/(devel|latest)/ansible-vault.html" "/ansible/$1/cli/ansible-vault.html"
RedirectMatch permanent "^/ansible/(devel|latest)/ansible-pull.html" "/ansible/$1/cli/ansible-pull.html"
RedirectMatch permanent "^/ansible/(devel|latest)/ansible-playbook.html" "/ansible/$1/cli/ansible-playbook.html"
RedirectMatch permanent "^/ansible/(devel|latest)/ansible-inventory.html" "/ansible/$1/cli/ansible-inventory.html"
RedirectMatch permanent "^/ansible/(devel|latest)/ansible-galaxy.html" "/ansible/$1/cli/ansible-galaxy.html"
RedirectMatch permanent "^/ansible/(devel|latest)/ansible-doc.html" "/ansible/$1/cli/ansible-doc.html"
RedirectMatch permanent "^/ansible/(devel|latest)/ansible-console.html" "/ansible/$1/cli/ansible-console.html"
RedirectMatch permanent "^/ansible/(devel|latest)/ansible-config.html" "/ansible/$1/cli/ansible-config.html"

# Getting Started

RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/basic_concepts.html" "/ansible/$1/getting_started/basic_concepts.html"

RedirectMatch permanent "^/ansible/(devel|latest)/intro_getting_started.html" "/ansible/$1/getting_started/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/intro_getting_started.html" "/ansible/$1/getting_started/index.html"

RedirectMatch permanent "^/ansible/(devel|latest)/intro.html" "/ansible/$1/getting_started/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/intro.html" "/ansible/$1/getting_started/index.html"

RedirectMatch permanent "^/ansible/(devel|latest)/quickstart.html" "/ansible/$1/getting_started/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/quickstart.html" "/ansible/$1/getting_started/index.html"

# Inventory Guide

RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/connection_details.html" "/ansible/$1/inventory_guide/connection_details.html"

RedirectMatch permanent "^/ansible/(devel|latest)/intro_inventory.html" "/ansible/$1/inventory_guide/intro_inventory.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/intro_inventory.html" "/ansible/$1/inventory_guide/intro_inventory.html"

RedirectMatch permanent "^/ansible/(devel|latest)/intro_patterns.html" "/ansible/$1/inventory_guide/intro_patterns.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/intro_patterns.html" "/ansible/$1/inventory_guide/intro_patterns.html"

RedirectMatch permanent "^/ansible/(devel|latest)/intro_dynamic_inventory.html" "/ansible/$1/inventory_guide/intro_dynamic_inventory.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/intro_dynamic_inventory.html" "/ansible/$1/inventory_guide/intro_dynamic_inventory.html"

# Command Line Tools

RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/cheatsheet.html" "/ansible/$1/command_guide/cheatsheet.html"

RedirectMatch permanent "^/ansible/(devel|latest)/command_line_tools.html" "/ansible/$1/command_guide/command_line_tools.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/command_line_tools.html" "/ansible/$1/command_guide/command_line_tools.html"

RedirectMatch permanent "^/ansible/(devel|latest)/intro_adhoc.html" "/ansible/$1/command_guide/intro_adhoc.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/intro_adhoc.html" "/ansible/$1/command_guide/intro_adhoc.html"

# Playbook Guide

RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/complex_data_manipulation.html" "/ansible/$1/playbook_guide/complex_data_manipulation.html"

RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_module_defaults.html" "/ansible/$1/playbook_guide/playbooks_module_defaults.html"

RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_vars_facts.html" "/ansible/$1/playbook_guide/playbooks_vars_facts.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks.html" "/ansible/$1/playbook_guide/playbooks.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks.html" "/ansible/$1/playbook_guide/playbooks.html"

RedirectMatch permanent "^/ansible/(devel|latest)/become.html" "/ansible/$1/playbook_guide/playbooks_privilege_escalation.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/become.html" "/ansible/$1/playbook_guide/playbooks_privilege_escalation.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_advanced_syntax.html" "/ansible/$1/playbook_guide/playbooks_advanced_syntax.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_advanced_syntax.html" "/ansible/$1/playbook_guide/playbooks_advanced_syntax.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_async.html" "/ansible/$1/playbook_guide/playbooks_async.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_async.html" "/ansible/$1/playbook_guide/playbooks_async.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_best_practices.html" "/ansible/$1/tips_tricks/ansible_tips_tricks.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_best_practices.html" "/ansible/$1/tips_tricks/ansible_tips_tricks.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_blocks.html" "/ansible/$1/playbook_guide/playbooks_blocks.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_blocks.html" "/ansible/$1/playbook_guide/playbooks_blocks.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_checkmode.html" "/ansible/$1/playbook_guide/playbooks_checkmode.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_checkmode.html" "/ansible/$1/playbook_guide/playbooks_checkmode.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_conditionals.html" "/ansible/$1/playbook_guide/playbooks_conditionals.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_conditionals.html" "/ansible/$1/playbook_guide/playbooks_conditionals.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_debugger.html" "/ansible/$1/playbook_guide/playbooks_debugger.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_debugger.html" "/ansible/$1/playbook_guide/playbooks_debugger.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_delegation.html" "/ansible/$1/playbook_guide/playbooks_delegation.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_delegation.html" "/ansible/$1/playbook_guide/playbooks_delegation.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_environment.html" "/ansible/$1/playbook_guide/playbooks_environment.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_environment.html" "/ansible/$1/playbook_guide/playbooks_environment.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_error_handling.html" "/ansible/$1/playbook_guide/playbooks_error_handling.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_error_handling.html" "/ansible/$1/playbook_guide/playbooks_error_handling.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_filters_ipaddr.html" "/ansible/$1/collections/ansible/utils/index.html#plugins-in-ansible-utils"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_filters_ipaddr.html" "/ansible/$1/collections/ansible/utils/index.html#plugins-in-ansible-utils"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_filters.html" "/ansible/$1/playbook_guide/playbooks_filters.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_filters.html" "/ansible/$1/playbook_guide/playbooks_filters.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_intro.html" "/ansible/$1/playbook_guide/playbooks_intro.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_intro.html" "/ansible/$1/playbook_guide/playbooks_intro.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_lookups.html" "/ansible/$1/playbook_guide/playbooks_lookups.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_lookups.html" "/ansible/$1/playbook_guide/playbooks_lookups.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_loops.html" "/ansible/$1/playbook_guide/playbooks_loops.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_loops.html" "/ansible/$1/playbook_guide/playbooks_loops.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_prompts.html" "/ansible/$1/playbook_guide/playbooks_prompts.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_prompts.html" "/ansible/$1/playbook_guide/playbooks_prompts.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_reuse_includes.html" "/ansible/$1/playbook_guide/playbooks_reuse.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_reuse_includes.html" "/ansible/$1/playbook_guide/playbooks_reuse.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_reuse_roles.html" "/ansible/$1/playbook_guide/playbooks_reuse_roles.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_reuse_roles.html" "/ansible/$1/playbook_guide/playbooks_reuse_roles.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_reuse.html" "/ansible/$1/playbook_guide/playbooks_reuse.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_reuse.html" "/ansible/$1/playbook_guide/playbooks_reuse.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_startnstep.html" "/ansible/$1/playbook_guide/playbooks_startnstep.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_startnstep.html" "/ansible/$1/playbook_guide/playbooks_startnstep.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_strategies.html" "/ansible/$1/playbook_guide/playbooks_strategies.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_strategies.html" "/ansible/$1/playbook_guide/playbooks_strategies.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_tags.html" "/ansible/$1/playbook_guide/playbooks_tags.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_tags.html" "/ansible/$1/playbook_guide/playbooks_tags.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_tests.html" "/ansible/$1/playbook_guide/playbooks_tests.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_tests.html" "/ansible/$1/playbook_guide/playbooks_tests.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_variables.html" "/ansible/$1/playbook_guide/playbooks_variables.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_variables.html" "/ansible/$1/playbook_guide/playbooks_variables.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbook_pathing.html" "/ansible/$1/playbook_guide/playbook_pathing.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbook_pathing.html" "/ansible/$1/playbook_guide/playbook_pathing.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_python_version.html" "/ansible/$1/playbook_guide/playbooks_python_version.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_python_version.html" "/ansible/$1/playbook_guide/playbooks_python_version.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_roles.html" "/ansible/$1/playbook_guide/playbooks_roles.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_roles.html" "/ansible/$1/playbook_guide/playbooks_roles.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_special_topics.html" "/ansible/$1/playbook_guide/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_special_topics.html" "/ansible/$1/playbook_guide/index.html"

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_templating.html" "/ansible/$1/playbook_guide/playbooks_templating.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/playbooks_templating.html" "/ansible/$1/playbook_guide/playbooks_templating.html"

# Vault

RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_vault.html" "/ansible/$1/vault_guide/index.html"

RedirectMatch permanent "^/ansible/(devel|latest)/vault.html" "/ansible/$1/vault_guide/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/vault.html" "/ansible/$1/vault_guide/index.html"

# Next two redirects are related to PR 74834 (link still exists in 2.9 error messages)

RedirectMatch permanent "^/ansible/playbooks_vault.html" "/ansible/latest/vault_guide/index.html"
RedirectMatch permanent "^/ansible/network_debug_troubleshooting.html" "/ansible/latest/network/user_guide/network_debug_troubleshooting.html#category-unable-to-open-shell"

# Modules and plugins

RedirectMatch permanent "^/ansible/(devel|latest)/modules.html" "/ansible/$1/module_plugin_guide/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/modules.html" "/ansible/$1/module_plugin_guide/index.html"

RedirectMatch permanent "^/ansible/(devel|latest)/modules_intro.html" "/ansible/$1/module_plugin_guide/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/modules_intro.html" "/ansible/$1/module_plugin_guide/index.html"

RedirectMatch permanent "^/ansible/(devel|latest)/modules_support.html" "/ansible/$1/module_plugin_guide/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/modules_support.html" "/ansible/$1/module_plugin_guide/index.html"

RedirectMatch permanent "^/ansible/(devel|latest)/plugin_filtering_config.html" "/ansible/$1/module_plugin_guide/plugin_filtering_config.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/plugin_filtering_config.html" "/ansible/$1/module_plugin_guide/plugin_filtering_config.html"

# Collections

RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/collections_using.html" "/ansible/$1/collections_guide/index.html"

# Windows and BSD Guide

RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/windows_performance.html" "/ansible/$1/os_guide/windows_performance.html"

RedirectMatch permanent "^/ansible/(devel|latest)/windows.html" "/ansible/$1/os_guide/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/windows.html" "/ansible/$1/os_guide/index.html"

RedirectMatch permanent "^/ansible/(devel|latest)/intro_bsd.html" "/ansible/$1/os_guide/intro_bsd.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/intro_bsd.html" "/ansible/$1/os_guide/intro_bsd.html"

RedirectMatch permanent "^/ansible/(devel|latest)/intro_windows.html" "/ansible/$1/os_guide/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/intro_windows.html" "/ansible/$1/os_guide/index.html"

RedirectMatch permanent "^/ansible/(devel|latest)/windows_dsc.html" "/ansible/$1/os_guide/windows_dsc.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/windows_dsc.html" "/ansible/$1/os_guide/windows_dsc.html"

RedirectMatch permanent "^/ansible/(devel|latest)/windows_faq.html" "/ansible/$1/os_guide/windows_faq.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/windows_faq.html" "/ansible/$1/os_guide/windows_faq.html"

RedirectMatch permanent "^/ansible/(devel|latest)/windows_setup.html" "/ansible/$1/os_guide/windows_setup.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/windows_setup.html" "/ansible/$1/os_guide/windows_setup.html"

RedirectMatch permanent "^/ansible/(devel|latest)/windows_usage.html" "/ansible/$1/os_guide/windows_usage.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/windows_usage.html" "/ansible/$1/os_guide/windows_usage.html"

RedirectMatch permanent "^/ansible/(devel|latest)/windows_winrm.html" "/ansible/$1/os_guide/windows_winrm.html"
RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/windows_winrm.html" "/ansible/$1/os_guide/windows_winrm.html"

# Tips and tricks

RedirectMatch permanent "^/ansible/(devel|latest)/user_guide/sample_setup.html" "/ansible/$1/tips_tricks/sample_setup.html"

# Installation Guide

RedirectMatch permanent "^/ansible/(devel|latest)/intro_configuration.html" "/ansible/$1/installation_guide/intro_configuration.html"
RedirectMatch permanent "^/ansible/(devel|latest)/intro_installation.html" "/ansible/$1/installation_guide/intro_installation.html"

# Module list landing topics

RedirectMatch permanent "^/ansible/(devel|latest)/network_maintained.html" "/ansible/$1/modules/network_maintained.html"
RedirectMatch permanent "^/ansible/(devel|latest)/partner_maintained.html" "/ansible/$1/modules/partner_maintained.html"
RedirectMatch permanent "^/ansible/(devel|latest)/community_maintained.html" "/ansible/$1/modules/community_maintained.html"
RedirectMatch permanent "^/ansible/(devel|latest)/core_maintained.html" "/ansible/$1/modules/core_maintained.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_windows_modules.html" "/ansible/$1/modules/list_of_windows_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_web_infrastructure_modules.html" "/ansible/$1/modules/list_of_web_infrastructure_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_utilities_modules.html" "/ansible/$1/modules/list_of_utilities_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_system_modules.html" "/ansible/$1/modules/list_of_system_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_storage_modules.html" "/ansible/$1/modules/list_of_storage_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_source_control_modules.html" "/ansible/$1/modules/list_of_source_control_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_remote_management_modules.html" "/ansible/$1/modules/list_of_remote_management_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_packaging_modules.html" "/ansible/$1/modules/list_of_packaging_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_notification_modules.html" "/ansible/$1/modules/list_of_notification_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_network_modules.html" "/ansible/$1/modules/list_of_network_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_net_tools_modules.html" "/ansible/$1/modules/list_of_net_tools_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_monitoring_modules.html" "/ansible/$1/modules/list_of_monitoring_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_messaging_modules.html" "/ansible/$1/modules/list_of_messaging_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_inventory_modules.html" "/ansible/$1/modules/list_of_inventory_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_identity_modules.html" "/ansible/$1/modules/list_of_identity_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_files_modules.html" "/ansible/$1/modules/list_of_files_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_database_modules.html" "/ansible/$1/modules/list_of_database_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_crypto_modules.html" "/ansible/$1/modules/list_of_crypto_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_commands_modules.html" "/ansible/$1/modules/list_of_commands_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_clustering_modules.html" "/ansible/$1/modules/list_of_clustering_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_cloud_modules.html" "/ansible/$1/modules/list_of_cloud_modules.html"
RedirectMatch permanent "^/ansible/(devel|latest)/list_of_all_modules.html" "/ansible/$1/modules/list_of_all_modules.html"

# Networking Guide

RedirectMatch permanent "^/ansible/(devel|latest)/network_best_practices_2.5.html" "/ansible/$1/network/user_guide/network_best_practices_2.5.html"
RedirectMatch permanent "^/ansible/(devel|latest)/network_debug_troubleshooting.html" "/ansible/$1/network/user_guide/network_debug_troubleshooting.html"
RedirectMatch permanent "^/ansible/(devel|latest)/network_working_with_command_output.html" "/ansible/$1/network/user_guide/network_working_with_command_output.html"
RedirectMatch permanent "^/ansible/(devel|latest)/network.html" "/ansible/$1/network/index.html"
RedirectMatch permanent "^/ansible/(devel|latest)/intro_networking.html" "/ansible/$1/network/index.html"

# Plugins list

RedirectMatch permanent "^/ansible/(devel|latest)/plugins.html" "/ansible/$1/plugins/plugins.html"

# Porting Guide

RedirectMatch permanent "^/ansible/(devel|latest)/porting_guide_2.0.html" "/ansible/$1/porting_guides/porting_guide_2.0.html"
RedirectMatch permanent "^/ansible/(devel|latest)/porting_guide_2.3.html" "/ansible/$1/porting_guides/porting_guide_2.3.html"
RedirectMatch permanent "^/ansible/(devel|latest)/porting_guide_2.4.html" "/ansible/$1/porting_guides/porting_guide_2.4.html"
RedirectMatch permanent "^/ansible/(devel|latest)/porting_guide_2.5.html" "/ansible/$1/porting_guides/porting_guide_2.5.html"
RedirectMatch permanent "^/ansible/(devel|latest)/porting_guides.html" "/ansible/$1/porting_guides/porting_guides.html"

# Reference and Appendices

RedirectMatch permanent "^/ansible/(devel|latest)/common_return_values.html" "/ansible/$1/reference_appendices/common_return_values.html"
RedirectMatch permanent "^/ansible/(devel|latest)/config.html" "/ansible/$1/reference_appendices/config.html"
RedirectMatch permanent "^/ansible/(devel|latest)/faq.html" "/ansible/$1/reference_appendices/faq.html"
RedirectMatch permanent "^/ansible/(devel|latest)/galaxy.html" "/ansible/$1/galaxy/user_guide.html"
RedirectMatch permanent "^/ansible/(devel|latest)/reference_appendices/galaxy.html" "/ansible/$1/galaxy/user_guide.html"
RedirectMatch permanent "^/ansible/(devel|latest)/glossary.html" "/ansible/$1/reference_appendices/glossary.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_aci.html" "/ansible/$1/reference_appendices/guide_aci.html"
RedirectMatch permanent "^/ansible/(devel|latest)/playbooks_keywords.html" "/ansible/$1/reference_appendices/playbooks_keywords.html"
RedirectMatch permanent "^/ansible/(devel|latest)/python_3_support.html" "/ansible/$1/reference_appendices/python_3_support.html"
RedirectMatch permanent "^/ansible/(devel|latest)/release_and_maintenance.html" "/ansible/$1/reference_appendices/release_and_maintenance.html"
RedirectMatch permanent "^/ansible/(devel|latest)/test_strategies.html" "/ansible/$1/reference_appendices/test_strategies.html"
RedirectMatch permanent "^/ansible/(devel|latest)/tower.html" "/ansible/$1/reference_appendices/tower.html"
RedirectMatch permanent "^/ansible/(devel|latest)/YAMLSyntax.html" "/ansible/$1/reference_appendices/YAMLSyntax.html"

# Scenario Guides

RedirectMatch permanent "^/ansible/(devel|latest)/guide_aws.html" "/ansible/$1/scenario_guides/guide_aws.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_azure.html" "/ansible/$1/scenario_guides/guide_azure.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_cloudstack.html" "/ansible/$1/scenario_guides/guide_cloudstack.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_docker.html" "/ansible/$1/scenario_guides/guide_docker.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_gce.html" "/ansible/$1/scenario_guides/guide_gce.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_kubernetes.html" "/ansible/$1/scenario_guides/guide_kubernetes.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_packet.html" "/ansible/$1/scenario_guides/guide_packet.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_rax.html" "/ansible/$1/scenario_guides/guide_rax.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_rolling_upgrade.html" "/ansible/$1/user_guide/guide_rolling_upgrade.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_vagrant.html" "/ansible/$1/scenario_guides/guide_vagrant.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guide_vmware.html" "/ansible/$1/scenario_guides/guide_vmware.html"
RedirectMatch permanent "^/ansible/(devel|latest)/guides.html" "/ansible/$1/scenario_guides/guides.html"

# Redirects for PR 54554, changes to Scenario Guides

RedirectMatch permanent "^/ansible/(devel|latest)/scenario_guides/guide_rolling_upgrade.html" "/ansible/$1/user_guide/guide_rolling_upgrade.html"
RedirectMatch permanent "^/ansible/(devel|latest)/vmware/scenario_?(.+)?" "/ansible/$1/scenario_guides/vmware_scenarios/vmware_scenarios.html"
RedirectMatch permanent "^/ansible/(devel|latest)/vmware/scenarios.html" "/ansible/$1/scenario_guides/vmware_scenarios/vmware_scenarios.html"
RedirectMatch permanent "^/ansible/(devel|latest)/vmware/faq.html" "/ansible/$1/scenario_guides/vmware_scenarios/faq.html"
RedirectMatch permanent "^/ansible/(devel|latest)/vmware/index.html" "/ansible/$1/scenario_guides/guide_vmware.html"
RedirectMatch permanent "^/ansible/(devel|latest)/vmware/vmware_?(.+)?" "/ansible/$1/scenario_guides/guide_vmware.html"

# Redirect old support pages per request from product team

RedirectMatch permanent "^\/ansible-tower\/((2\.\d\.\d)|3\.[0-3]\.\d)\/html(_\w+)?\/.*updates_support\.html$" "/ansible-tower/latest/html$3/installandreference/updates_support.html"