URL Replace Filter

David Lesieur - March 14, 2007 - 18:31

Allows administrators to replace the base URL in <img> and <a> elements.

Users tend to create links and images in their content with absolute URLs. This can be a problem if the site moves to another domain (perhaps between development and production sites) or is behind a proxy, with a different address for authenticated users.

Some replacement examples:

Before: <a href="http://example.com:8080/somepath">Some link</a>
After: <a href="/somepath">Some link</a>

Before: <img src="http://dev.example.com/files/image.jpg" alt="Some image" />
After: <img src="/files/image.jpg" alt="Some image" />

You can setup such replacements in the URL Replace Filter settings as follow:

Original: http://example.com:8080/
Replacement: %baseurl/

Original: http://dev.example.com/
Replacement: %baseurl/

%baseurl is a token for your site's base URL. The above examples assume a site located in the domain's root directory (in which case %baseurl is actually empty).

Releases

Official releasesDateSizeLinksStatus
5.x-1.02007-Aug-147.93 KBRecommended for 5.xThis is currently the recommended release for 5.x.
4.7.x-1.02007-May-287.14 KBRecommended for 4.7.xThis is currently the recommended release for 4.7.x.
 
 

Drupal is a registered trademark of Dries Buytaert.