Forums / Developer / /content/download/ not found

/content/download/ not found

Author Message

Damien MARTIN

Monday 14 June 2010 1:30:12 am

Hi there,

I encounter a strange behaviour in eZ 4.0 for now.

A website who have duplicated add the following error :

When I want to download a binary file (avi file), I use an URL like /content/download/300/1545/file/usinage2.avi

But it return a Apache error (404 Not Found).

So if I try index.php/content/download/300/1545/file/usinage2.avi I get an eZ error : Module not found.

On the base website it works without any problems.

Does anyone has an idea of where this error could be from ?

Thanks

NB : The folders/files rights are the same

André R.

Monday 14 June 2010 1:46:16 am

For the first case, issues with other url's as well? Rewrite rules?

For the second case, is the file actually there? Did you copy the storage folders in var?

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Damien MARTIN

Monday 14 June 2010 2:01:35 am

Hi André,

For the first case, there is no issue and rewrite rules are OK.

For the second case, the files are there (the var files have been copied).

The things that annoy me the most is the fact that eZ said module not found (there is the link : http://grm.2si-systemes.fr/index.php/content/download/300/1545/file/usinage2.avi)

This is the .htaccess used in the two sites :

php_value allow_call_time_pass_reference 0

<FilesMatch ".">
        order allow,deny
        allow from all
</FilesMatch>

<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html|avi|mp3|swf|flv|cur|ani|php|kml|xml|wmv)|var(.+)storage.pdf(.+)\.pdf)$">
        order allow,deny
        allow from all
</FilesMatch>

RewriteEngine On
RewriteRule content/treemenu/?$ index_treemenu.php
RewriteRule index_treemenu.php - [L]

RewriteRule !\.(gif|jpe?g|png|css|js|html|avi|mp3|swf|flv|cur|ani|php|kml|xml|wmv)|var(.+)storage.pdf(.+)\.pdf$ index.php

DirectoryIndex index.php

André R.

Monday 14 June 2010 5:59:36 am

the reason is that you have added an very optimistic match for avi files (and many others).
I don't use .htaccess my self, so not sure what is best but it makes apache try to serve the file, and when you add index.php, eZ Publish does not recognize index.php as a module (read the error).
Just try changeing the file type to make sure it falls true the rewrite rules correclty:

http://grm.2si-systemes.fr/index.php/content/download/300/1545/file/usinage2.av

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Damien MARTIN

Wednesday 16 June 2010 2:06:08 am

Hi there,

I just solved the problem changing the download URL from

/content/download/300/1545/file/usinage2.avi

to

/content/download/300/1545/file

Hopes It could help others.