Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module converts absolute links within your content to relative links during content migration. It's useful for preventing links from pointing to an old production site when you move content to a new site or a testing environment. By specifying your site's base URLs, the module will rewrite links that match those URLs to be relative paths, ensuring they work correctly on the new site.

Provides a migration process plugin that converts absolute links to relative.

Inspired by the Pathologic module, a list of 'base urls' may be provided as parameters and any absolute links that start with these base urls are converted to relative links.

This is designed to avoid the problem that occurs when migrating a production site and then creating a test site to examine the new content. Typically there would be many embedded links in body fields that would point back to the production site. If this process filter is used correctly during migration then all 'absolute' links to content within the same site will be replaced by relative links.

Once the module is installed, you may then add the 'filter_absolute_links' plugin to your migration Yaml file as shown in the following example:

plugin: filter_absolute_links
replace_urls:
    http://www.mysitename.co.uk
    https://www.mysitename.co.uk
    http://test-sitename.net

This would most commonly be used to filter absolute links out of a body field.
In the example above, a link such as https://www.mysitename.co.uk/news would be converted to /news during the migration.
An 'external' link such as http://bbc.co.uk/news would be left untouched by the migration.

Activity

Total releases
1
First release
Feb 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
6.0.x-dev Dev Feb 10, 2025