My images are not showing. I have looked this question up but all of the solutions I found were over a year old and my settings.php file does not have a $base_url setting.

If you try to view an image with the browser, you can see it at localhost/mysite/sites/default/files/image.jpg, but Drupal is pointing to localhost/sites/default/files/image.jpg and the subdirectory is being left out.

How do I fix this?

I am using Drupal 8 on LAMP on Ubuntu 16.04.

  • I copied the sites folder for that drupal installation and pasted it in the /var/www/ directory and I now see the image. But, this is just a temporary fix and I bet there is a config setting I can change so that I do not need to copy and paste the sites folder outside of the drupal folder. – Olympus May 16 '16 at 22:58
  • Your problem is caused from having an unusual root. It can be easily avoided if you used virtual hosts. Is there a reason you are not using virtual hosts? – Eyal May 17 '16 at 4:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.