After inserting an image into a text area, the src attribute includes the domain name as well as the local file path. For example:


This can be problem when the domain changes, such as when moving from staging to live.

I'm thinking that the best src attribute would omit the domain completely. For example:


But I'm not sure if it should include the initial slash.

I suppose there might even be a configuration option that I'm missing, but I haven't found it yet. Is there? If not, I'd like to request a configuration option that allows the admin to choose whether the full domain should be included.

#3 887442_insert_readme.patch1005 bytesnadavoid
Members fund testing for the Drupal project. Drupal Association Learn more


nadavoid’s picture

Thanks for the links. I did search first, but now I realize I was only searching *open* issues. Oops.

nadavoid’s picture

Component: Code » Documentation
Status: Closed (duplicate) » Needs review
1005 bytes

Thank you for enabling this setting on an already super module.

Would you consider adding some or all of the attached README.txt patch? I added a note about the variable to add in settings.php, and fixed a couple of small typos.

Proposed new text:


By default, the path to the inserted file will be absolute, including the full
domain name, such as If
you prefer relative paths, such as /sites/default/files/image.jpg, add the
following variable to your settings.php file.

$conf['insert_absolute_paths'] = FALSE;


I set the status back to "needs review." Was that the right status to use for this?

quicksketch’s picture

Title: Complete domain is used in src. » Add information about using relative paths to README.txt
Status: Needs review » Fixed

Thanks, this sounds like a great idea. Perfect patch too. I committed this to both branches of Insert. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.