1

Ok, I've got a Drupal install with a lot of links inside various nodes. All of these links are relative.

The problem is that if they're going to say, an image or a pdf in the /sites/default/files directory, they stop working.

Let me give an example:

There is a link in a node like this:

/sites/default/files/image1.png

www.livesite.com/sites/default/files/image1.png works

www.domain.com/devsite/sites/default/files/image1.png does not work

How do I (easily) switch the links to work in such a way? Do I have to do an .htaccess edit, or is there something in the Drupal settings for this? This is for Drupal 7

3
  • 1
    This question has been addressed several time already here. Take a look at drupal.stackexchange.com/questions/10612/… for a start. Commented Nov 4, 2013 at 16:54
  • The rest of the site works though, just not the files folder stuff.
    – Jack Ryan
    Commented Nov 4, 2013 at 17:17
  • You need to adjust how URLs are rewritten for those to work, that's all. Commented Nov 4, 2013 at 17:25

1 Answer 1

2

You can use the module Pathologic that acts as a filter on your text formats (Full HTML, Filtered HTML) and basically rewrites URL's which are parts of fields depending the site configuration and Pathologic settings.

You can for example set Processed URL format to Path relative to server root (/foo/bar) and for the All base paths for this site, you fill in the different website URL's.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.