After installed ImageCache I noticed it won't create any preset directories. I did some research and noted this module relies on the .htaccess files and Clean URL to work properly. My Drupal 5.10 runs on IIS6 and uses Ionic's Isapi Rewrite Filter (IIRF) for generating clean urls. Can anyone kindly let me know if ImageCache can work with IIS6 + IIRF, and how? Thanks a lot.

Comments

danieljames’s picture

Hi, this is probably too late but I just ran into the same issue. The problem is that IIRF doesn't support the QSA flag which is used in the drupal .htaccess. So you need to emulate it. Here's the rule I'm using for drupal 6:

RewriteCond %{HTTP_HOST} ^example.com$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(?!favicon.ico$)([^?]*)(?:\?(.*))?$ /index.php?q=$1&$2 [L]

Which seems to work pretty well but I have no idea if this would work for drupal 5. The only guides to using IIS that I could find don't use IIRF (such as: http://drupal.org/node/182320, http://drupal.org/node/27141, http://drupal.org/node/46429).

It's possible to patch imagecache to work around this, but that would be the wrong solution as it's likely that other parts of drupal would have similar problems.

drewish’s picture

you might be able to get it working with private file transfers... currently the module is dependent on having mod_rewrite and clean URLs.

guyzalon’s picture

Same problem here... IIS and ImageCache can't live together :(

scifisi’s picture

There's a solution if you're using ISAPI_Rewrite here:

http://www.caspianit.co.uk/imagecache-wrong-path/

code by danieljames works perfectly for 6.x with IIRF nice one Daniel.

earthday47’s picture

+1 for comment #1 and scifisi's post. The combined solution of adding the IIRF rules AND copying the rules into the files dir's .htaccess worked.

Anonymous’s picture

+1 #4
This almost worked for me,
I was having issues seeing my file field thumbnails after doing what was recommended in #4, so instead of dropping a .htaccess in the sites/default/files dir, I dropped it in sites/default/files/imagecache and updated the rewrite rule to:
RewriteRule ^(.*)$ /index.php?q=sites/default/files/imagecache/$1 [L,QSA]

fizk’s picture

Status: Active » Closed (won't fix)