【发布时间】:2012-12-25 09:28:39
【问题描述】:
我的问题是。
我的应用程序有一个图像文件夹,并且在 zend 框架中具有裁剪技术,因此当请求裁剪的图像并且之前找到它时,htaccess 将通过调用裁剪模型来处理图像
the file requested is : http://localhost/cmstest/public/contents/userdata/images/100X100/163.png
但服务器无法读取正确的控制器
在这里访问代码
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)/(.*) ../../index/index/app/storage/image/$2/crop/$1 [QSA,L]
</IfModule>
显示的错误是
An error occurred
Page not found
Exception information:
Message: Invalid controller specified (contents)
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/zend/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /Applications/XAMPP/xamppfiles/htdocs/zend/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 /Applications/XAMPP/xamppfiles/htdocs/zend/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 /Applications/XAMPP/xamppfiles/htdocs/cmstest/public/index.php(36): Zend_Application->run()
#4 {main}
Request Parameters:
array (
'controller' => 'contents',
'action' => 'userdata',
'images' => '100X100',
'module' => 'frontend',
)
请帮帮我:(
【问题讨论】:
-
如何创建到控制器的链接?
-
RewriteRule ^(.*)/(.*) ../../index/index/app/storage/image/$2/crop/$1 [QSA,L] 这是控制器的链接
-
在 PHP 或 HTML 中如何创建链接?
-
php 或 html 是什么意思???我的问题是当我复制图像链接并将其粘贴到地址栏中时,我想查看调整大小的图像,如果以前没有调整大小,服务器必须请求 IndexController 和 indexAction,但服务器不能将文件夹“内容”作为控制器并忽略了 htaccess 文件中的索引控制器!
-
如果你的 apache 没有看到 .htaccess 文件。它应该在 apache 配置“AllowOverride All”中的某个位置。我的配置文件路径是 /etc/apache2/sites-enabled/000-default (如果是 AllowOverride None,请更正)
标签: zend-framework