2

This is for a Drupal 6 site, but I've seen this problem with Drupal 7 before too.

I migrated my site from a main domain (www.domain.org, let's say), to a development domain, with a subdirectory, (www.devlin.domain2.com/domainupgrade).

That breaks the images located in /sites/default/files, but not the files located in /sites/all/themes/themename

How can I fix this? I've tried changing file permissions (shot in the dark) as well as the base url setting (but I perhaps didn't change it to the correct value?)

How can I get images to show up in this context on the development site?

  • 1
    It's usually permissions, but can also be ownership. Make sure you chown -R apache:apache sites/default/files and chmod -R 777 sites/default/files. I'm assuming "apache" is the user and group of your webserver, but it might not be. – Scott Joudry Sep 4 '13 at 14:03
  • "breaks"? What is this word supposed to mean? HTTP 404? 403? 500? No error but no data? – Mołot Sep 4 '13 at 14:05
  • I think it would have to be ownership, if it's one or the other. I've already tried changing the permissions to 777. – Jack Ryan Sep 4 '13 at 14:05
  • Ah, the images (and I imagine other files) located in /sites/default/files do not show. Firebug says, "Failed to load the given URL". Everything else on the site works fine. – Jack Ryan Sep 4 '13 at 14:06
  • try editing the image path in firebug itself,for me it looks like there is a mismatch in the path given to images in your css file, to test the path you can put the same path to your browser tab and can see if image shows up or not – arpitr Sep 4 '13 at 14:12
1

I appreciate that this is an old post but after days of trying to resolve the problem I have seen many of these posts and want to update with my solution.

My web host is classed as a shared web host which means for me that I don't have as much access to the server side as with other hosts. The control area for the admin on my host is custom and lots of stuff that I have with another host and previous hosts id missing.

I resolved the images not showing by adjusting the .htaccess file. There are 2 that I have found so far in Drupal 7.24 (one in the site root and one in sites/default/files/) and I had to adjust both of them by commenting out the options section and the symlinks section. There is info on this by googling "one.com Drupal Installation".

Once both htaccess files had been edited and the permissions had been changed on the "files" folder in "sites/default/" to "755" the extra folders where created when I uploaded my images and the images started to show fine. If like me you are unable to change permissions within your website hosts control panel you will need to do it with either an ftp client or via ssh.

0

I had this same problem when I cloned my D 7.5 site from a hosting account to my local XAMPP server. None of the above suggestions worked. However, when I removed the leading slash in the image location path HTML it worked.

So, my HTML source as running fine on remote hosting account works as

/sites/default/files/Complicated.png

Have to change that to

sites/default/files/Complicated.png

(removed leading slash) to get it to work on my local migrated site.

So, while this is an answer I still don't know what in my setup/environment would cause this to be different for two identical D7 sites? I don't want to have to manually go through my large site editing image paths.

0

Try changing +FollowSymLinks to +SymLinksIfOwnerMatch in .htaccess file inside /sites/default/files/

Your Answer

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

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