On 06/16/2010 08:58 PM, i...@antoniocaccese.it wrote:
How i have to apply your rule because i'am getting an internal server
error.
Can you post the entire rule? The current rule must be deleted?
Thank for your help.

Citando Nilesh Govindarajan <li...@itech7.com>:

On 06/16/2010 08:37 PM, i...@antoniocaccese.it wrote:
Hi,
in my application i have a the classic .htaccess file like:

SetEnv APPLICATION_ENV development
RewriteEngine on
RewriteRule
!\.(js|ico|gif|jpg|jpeg|png|css|txt|rtf|pdf|doc|docx|xls|xlsx|ppt|pptx|mov|mpg|mp3|mp4|mpeg|avi|wmv|wmx|xml)$

index.php


Then, in the router I added the following routing rule:

$download = new Zend_Controller_Router_Route(
:language/download/:filename',
array(
'module' => 'core',
'controller' => 'file',
'action' => 'download'
),
array(
'language' => '[a-z]{2}'
)
);

This rule should match Url like these:

/it/download/caccese_4c18db4b97171.pdf
/en/download/another_name_of_a_file.doc

but i get a not found error:

Not Found
The requested URL /it/download/caccese_4c18db4b97171.pdf was not found
on this server.


There is a way to change htaccess to fix this or there is another
solution?


Try with a rewrite rule like .*\.(your stuff)

--
Regards,
Nilesh Govindarajan
Facebook: http://www.facebook.com/nilesh.gr
Twitter: http://twitter.com/nileshgr
Website: http://www.itech7.com
Cheap and Reliable VPS Hosting: http://j.mp/arHk5e



You may try this:

RewriteEngine on
RewriteRule .*\.(js|ico|gif|jpg|jpeg|png|css|txt|rtf|pdf|doc|docx|xls|xlsx|ppt|pptx|mov|mpg|mp3|mp4|mpeg|avi|wmv|wmx|xml)$ index.php

If you want all non-existent file requests to be redirected to ZF, then use this:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php

--
Regards,
Nilesh Govindarajan
Facebook: http://www.facebook.com/nilesh.gr
Twitter: http://twitter.com/nileshgr
Website: http://www.itech7.com
Cheap and Reliable VPS Hosting: http://j.mp/arHk5e

Reply via email to