Perhaps rather than requiring the user to disable the 'security' .htaccess file in the files directory, we should over-ride it another .htaccess file which re-enabled mod_rewrite ONLY for the imagecache dirctory. We can automatically create and install this file in the proper place during the install routine. The following seems like it would solve the problem:

Create an .htaccess file in the files/imagecache directory. Paste these contents:

SetHandler Image_Cache_Rewrite
Options FollowSymlinks
<IfModule mod_rewrite.c>
  # Re-enable clean urls for the imagecache diretory
  RewriteEngine on

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ ../../index.php?q=files/imagecache/$1 [L,QSA]  
</IfModule>

This file would need to be generated by PHP, as the location to the root directory of Drupal will vary by installation.

Comments

dopry’s picture

Status: Active » Closed (won't fix)

In DRUPAL-4-7 and DRUPAL-5 this change has already been made... I'm not sure if it is in the current 4.7.3 tar ball... I'll check later, but lets no fix core bugs from contrib modules.

quicksketch’s picture

Great, I hadn't been aware of the changes. I'm glad we can avoid the hack.