| 1 |
$Id: README.txt,v 1.1.2.1 2007/08/14 03:04:02 davidlesieur Exp $
|
| 2 |
|
| 3 |
README file for the URL Replace Filter Drupal module.
|
| 4 |
|
| 5 |
|
| 6 |
Description
|
| 7 |
***********
|
| 8 |
|
| 9 |
The URL Replace Filter module allows administrators to replace the base URL in
|
| 10 |
<img> and <a> elements.
|
| 11 |
|
| 12 |
Users tend to create links and images in their content with absolute URLs. This
|
| 13 |
can be a problem if the site moves to another domain (perhaps between
|
| 14 |
development and production sites) or is behind a proxy, with a different address
|
| 15 |
for authenticated users.
|
| 16 |
|
| 17 |
Some replacement examples:
|
| 18 |
|
| 19 |
Before: <a href="http://example.com:8080/somepath">Some link</a>
|
| 20 |
After: <a href="/somepath">Some link</a>
|
| 21 |
|
| 22 |
Before: <img src="http://dev.example.com/files/image.jpg" alt="Some image" />
|
| 23 |
After: <img src="/files/image.jpg" alt="Some image" />
|
| 24 |
|
| 25 |
You can setup such replacements in the URL Replace Filter settings as follow:
|
| 26 |
|
| 27 |
Original: http://example.com:8080/
|
| 28 |
Replacement: %baseurl/
|
| 29 |
|
| 30 |
Original: http://dev.example.com/
|
| 31 |
Replacement: %baseurl/
|
| 32 |
|
| 33 |
%baseurl is a token for your site's base URL. The above examples assume a site
|
| 34 |
%located in the domain's root directory (in which case %baseurl is actually
|
| 35 |
%empty).
|
| 36 |
|
| 37 |
Like any Drupal filter, the original user-entered content is not altered. The
|
| 38 |
filter is only applied (and its result cached) when the node is viewed.
|
| 39 |
|
| 40 |
|
| 41 |
Installation
|
| 42 |
************
|
| 43 |
|
| 44 |
1. Extract the 'url_replace_filter' module directory into your site's modules
|
| 45 |
directory.
|
| 46 |
|
| 47 |
2. Go to the Administer > Site configuration > Input formats page, and click
|
| 48 |
configure next to the input format that shall replace URLs.
|
| 49 |
|
| 50 |
3. Enable the URL Replace Filter in the input format's configuration page, and
|
| 51 |
save the configuration.
|
| 52 |
|
| 53 |
4. Click the Configure tab. In the URL Replace Filter box, enter original and
|
| 54 |
replacement URLs in the appropriate fields and save the configuration. More
|
| 55 |
empty replacement fields will automatically be added after saving, in case
|
| 56 |
you need more fields than provided by default.
|