Download & Extend

URL Replace Filter

The module settings at admin/settings/filters/(filter)/configure

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).

See also

Downloads

Recommended releases

Version Downloads Date Links
5.x-1.0 tar.gz (7.93 KB) | zip (8.92 KB) 2007-Aug-14 Notes
4.7.x-1.0 tar.gz (7.14 KB) | zip (7.46 KB) 2007-May-28 Notes

Development releases

Version Downloads Date Links
6.x-1.x-dev tar.gz (7.95 KB) | zip (8.81 KB) 2011-Feb-25 Notes

Project Information


Maintainers for URL Replace Filter

  • fgm - 4 commits
    last: 4 years ago, first: 4 years ago
  • David Lesieur - 5 commits
    last: 5 years ago, first: 6 years ago

Issues for URL Replace Filter

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Statistics (2 years)
New issues
Open bugs
Participants