So there's a site I need to redesign for a client. This website is currently in Drupal 6 (yes I know). I've installed a copy of this website in my computer using MAMP and I am able to run the website without problem.

However, all image files are broken. I've checked the path and they are pointing to:


instead of


Is there something I need to change in the Drupal admin in order to re-assign the correct image path? Some configuration I might be missing? There are a lot of images so manually doing this would be a pain.

Thanks a lot for your help!

3 Answers 3


It could potentially be solved by just adding a Virtualhost in your httpd.conf

In /Applications/MAMP/conf/apache/httpd.conf, add the following Virtualhost to the very bottom.

<VirtualHost *:80>
  ServerName mywebsite.sandbox
  DocumentRoot /path/to/mywebsite/on/Mac
  <Directory /path/to/mywebsite/on/Mac>
    Options FollowSymLinks
    Order allow,deny
    Allow from all
  ErrorLog /var/log/apache2/mywebsite-error.log
  CustomLog /var/log/apache2/mywebsite-access.log combined

The path, for example, would be the absolute path on your computer. So if you keep all of your sites in a Development folder in your Documents, it would look something like this.


In /etc/hosts, add the server name. mywebsite.sandbox

Restart MAMP and you should be good to go using http://mywebsite.sandbox


Thats just because every image they have referenced has an src beginning with "/sites/..." so the preceding slash before the sites will be going to the root.

I guess you have to either sit your whole site on the root of your local host, to match the src of the images, or during development, copy the image directory into a sites folder on the root.

It isn't something you can change in Drupal settings to change all image paths, as they will have probably written the img src themselves, instead of the files being in the default /sites/default/files directory.

  • It might be worth creating a virtual machine so that you can host this website in the webroot. Alternatively, you could set up a virtual site in MAMP and set your hosts file accordingly. It really depends how comfortable you are doing these things.
    – Graham
    Commented Mar 11, 2014 at 18:26

The dirty answer is to make a symlink to the 'mywebsite/sites/all...' directory from the root of your MAMP install (the link called 'sites' of course). You may need to alter your Apache config to allow symlinks to be followed.

A slightly more elegant solution, but much more of a headache is to use rewrites in your Apache config to send a URL matching 'sites/all...' to 'mywebsite/sites/all...'.

You could also modify the $base_path global for Drupal, but you would need to do this before any other bootstrap processes, which would require a core hack (you do not want to do this), and would mean you would have to remember to change it everytime you updated and/or change it back once you finished developing. Again, you do not want to do this.

Most people using Drupal for their websites have only Drupal running their website, no static content, or images, css, js, or other files outside of the Drupal framework. It seems as though only developers need/want/have to think about these issues ... le sigh :(

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.