Reputation: 41
I have an issue in that I am trying to simply display an image within my images folder in a new window via an anchor link with target=blank.
I added the rewrite rule to the public folders .htaccess as explained in the post at : Zend keep front controller from blocking image requests but it is still giving me the error as below and cannot figure out why.
All other images used in the pages display fine, its only the images that are linked as:
<a href="/images/balloon.jpeg" target="_blank">Balloon</a>
The exception message is
Exception information:
Message: Invalid controller specified (images)
Stack trace:
#0 /home/euphoria/public_html/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /home/euphoria/public_html/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 /home/euphoria/public_html/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 /home/euphoria/public_html/public/index.php(25): Zend_Application->run()
#4 {main}
Request Parameters:
array (
'controller' => 'images',
'action' => 'profile_uploads',
'module' => 'default',
)
My public folder .htaccess is
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php
RewriteRule ^.*$ index.php [NC,L]
I have another .htaccess file within my images folder to stop php executions via the use of images files and its contents is
php_flag engine off
The above issue with Zend trying to redirect to an 'images' controller only started occuring when I added the above .htaccess to the images folder.
The problem disappears when I remove the .htaccess that has the "php_flag engine off" rule
The images and its folder are CHMOD 777 and the site is in its own domain on a shared hosting env. (As opposed to sub domain)
Many thanks
Upvotes: 1
Views: 525
Reputation: 70853
And you are sure that there is a folder "images" in your DOCUMENT_ROOT folder, and that it contains an image named "balloon.jpeg"?
The second rewrite rule essentially is useless.
Throw it out. The standard rewriting for Zend framework works. If it does not in your case, you did something wrong, most likely you did not place your image where it belongs.
Upvotes: 1