Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Migrate Absolute Links

No security coverage Maintenance fixes only 1 sites

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.

Ask your assistant about Migrate Absolute Links

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Aug 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
6.0.x-dev Dev 8–10 Feb 10, 2025
5.0.x-dev Dev 8–10 Jul 10, 2024
4.0.x-dev Dev 8–10 Aug 3, 2023
8.x-3.x-dev Dev 8–10 Aug 3, 2023