I have an mulitisite instalation. I would like to make site/[site.name.com]/files not be able to be accessed by other domain. When I added
# make the subdirectory to invisible (cannot be access by web server)
RewriteCond %{HTTP_HOST} ^(www.)?other-example.com$ [NC]
RewriteCond %{REQUEST_URI} ^/sites/example.com/(.*)$ [OR]
RewriteRule ^(.*)$ - [L,R=404]
in .htacess, imagecache does not work. Does anybody know why? and how can I solve the problem.
Note: I also posted this issue related to http://drupal.org/node/224913#comment-2529448.
hosais
Comments
Comment #1
kvarnelis commentedI have the same problem.
I have three sites I want imagecache on. They have identical sets of modules and versions of Drupal (everything is the most recent according to update status and yes beta10 of imagecache). They have identical htaccess files.
All 3 are running on the same server.
1 is sitting in a directory by itself. It works fine with anything I throw at it.
The other two are in a multisite install. These do not work. When I try to create a preset, it gives me a broken image for the druplicon sample.
I have verified that the sample image is in the proper directory.
On one site found an imagecache directory had been created. Since it seemed to have problems, I deleted it, recreated it and gave it 777 permissions.
Still no luck. Absolutely no difference in behavior.
When I open the link to the sample image, it brings me my site.
This seems like a common problem with imagecache. It's such a great module and I'd love to see it work on these two sites.
Comment #2
kvarnelis commentedI solved my problem, it was a matter of .htaccess in the files directory in the subdirectory for my site.
.htaccess was set to
There's the problem, rewriteengine off!
First I tried to set it to the .htaccess file in the troubleshooting imagecache page, which says it should be
That killed the theme for my site completely.
I then turned to an .htaccess file auto-generated by Drupal 6 (the first one was probably from Drupal 5).
This time, the code read
That worked!
Comment #3
Andrew Gorokhovets commentedIn my case the problem is not solved. I have checked up all as is specified here http://drupal.org/node/224913. However on page admin/build/imagecache/1 the image does not appear. Instead of it only URL. Besides on page, where is used imagecache, images is not present. The reason that imagecache not truly generates URL. In my case on page I see URL to image
On page admin/settings/file-system my configuration is:
files: sites/example.com/files
temp: sites/example.com/temp
P.S When I use only imagefield it's work greate.
Comment #4
Andrew Gorokhovets commentedI have committed an error. I have not included neither ImageAPI GD2, nor ImageAPI ImageMagick
Now all fix.
Comment #6
roball commentedandrey_jw and kvarnelis had unrelated setup mistakes which they could fix, but the problem reported by hosais is still not solved, unfortunately, and I was also hit by it.
Steps to reproduce:
Put an
.htaccessfile into the "File system path" directory defined at admin/settings/file-system (usually, something likesites/example.com/files), with the following content:When an image is uploaded to a node using the ImageField module, and the display style of that image is set to a thumbnail format, no image will be created at
/sites/example.com/files/imagecache/path_to/my_image.png, so the resulting image will have a broken src - thus no image is displayed.When commenting out the line
to
the problem is gone, so the ImageCache module has definitely a problem with Apache's RewriteRule directive.
Comment #7
roball commentedComment #8
roball commentedI have now found how to solve this issue:
In the
.htaccessfile residing in thesites/example.com/filesdirectory, themod_rewritesection should read as follows:Works fine for me with Apache 2.2 :-)