Hi, I'm using Virtualsite_manager, which works pretty well. For files attachments as well.
But I still can't get ImageCache 2.1 to called, Drupal always sends me a 404 not found from menu_execute_active_handler() on this test:
if ($path === '' || !isset($menu['callbacks'][$path])) {
return MENU_NOT_FOUND;
}
I'm using the .htaccess following rules :
RewriteEngine on
#file access
RewriteRule ^\w+/(modules|misc|files|themes|sites)(.*)$ ./$1$2 [L]
RewriteRule ^/(modules|misc|files|themes|sites)(.*)$ ./$1$2 [L]
#special php scripts
RewriteRule ^\w+/(update.php|install.php|index.php|cron.php)(.*)$ ./$1$2 [L,QSA]
#site sub-section
RewriteCond %{REQUEST_FILENAME} ^/Applications/MAMP/htdocs/dotc/site/.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^\w+(/)?(.*)$ index.php?q=$2 [L,QSA]
I gave a try by deleting 'files' from RewriteRule like this:
RewriteRule ^\w+/(modules|misc|themes|sites)(.*)$ ./$1$2 [L]
RewriteRule ^/(modules|misc|themes|sites)(.*)$ ./$1$2 [L]
This leads ImageCache to work properly, but attachements don't work anymore.
I'm not a Apache rewriting rules expert at all, but I guess I can fix the issue with a rule excluding only 'files//imagecache', but I don't know how to achieve this.
Help would be much appreciated!
Thank you all,
Jérémy
Comments
Comment #1
jchatard CreditAttribution: jchatard commentedJust correcting a typo in my previous comment:
I'm not a Apache rewriting rules expert at all, but I guess I can fix the issue with a rule excluding only 'files/site_shortname/imagecache', but I don't know how to achieve this.
Comment #2
jchatard CreditAttribution: jchatard commentedJust a quick note, when disabling URL aliases, all works fine!
Jérémy
Comment #3
schuyler1d CreditAttribution: schuyler1d commentedI'm not a Apache rewriting rules expert at all
get ready, my guess is by the end of this, you will be :-/
Just a quick note, when disabling URL aliases, all works fine!
in drupal? you mean clean urls or something else?
I don't have time atm to do testing on my side, but a shot in the dark would be something like this:
The trickiest part is that imagecache is specifically relying on the request being passed to drupal if and only if a file does not exist.
If you figure this out (or if the above magically worked), please post what you did here, so I can commit it back into the project! Otherwise I might have some time later this week or next.
Comment #4
jchatard CreditAttribution: jchatard commentedWouah thanks a lot, I'll give it a try tomorrow morning (midnight in France), and I'll let you know if it works!
In the mean time thank you!
Jérémy
Comment #5
jchatard CreditAttribution: jchatard commentedOk so it works great, appart for one thing. Now images are well generated, thank you!
But when I edit a node, the imagefield preview, which points to the original image, doesn't show and leads to a 404 not found page.
I guess a simple rule could let access files directly?
Jérémy
Comment #6
schuyler1d CreditAttribution: schuyler1d commentedwhat's the url of the imagefield preview image, and can you see these images from the view mode of the same node? It's possible this part is a bug in imagefield/imagecache instead.
Comment #7
jchatard CreditAttribution: jchatard commentedWell I don't think this is a bug due to Imgafield nor ImageCache, cause Drupal also generate a 404 for attached files as well! I'm using public method.
Seems like rewrite rules prevent from accessing files under "files/" directory.
Comment #8
jchatard CreditAttribution: jchatard commentedYou where right, this an issue due to imagefield. Many people seem to have the same. So I'll work on that.
Thanks
Comment #9
schuyler1d CreditAttribution: schuyler1d commentedkeeping this open for the patch to the rewrite rules. thanks for reporting