'Controller class xxxController could not be found error
I was migrating my web application to another server. Everything works fine except for viewing any uploaded file. It keeps showing the same error whenever I tried to view the uploaded file.
Updated :
eland\app\webroot\uploadNot Working --> <?php echo $this->Html->link(__('<i class="icon-file"></i>'), '../'.ELAND.'/upload/'.trim($rec['Bahanrujukan']['filename']), array('class' => 'btn btn-default btn-small','target'=>'_blank', 'escape' => false)); ?>
eland\app\webroot\img\imgsWorking --> <?php echo $this->Html->link(__('<i class="icon-file"></i>'), '../'.ELAND.'/img/imgs/'.trim($rec['Bahanrujukan']['filename']), array('class' => 'btn btn-default btn-small','target'=>'_blank', 'escape' => false)); ?>
Should I check the plugin or the controller?
Solution 1:[1]
It turns out that, the issue was misconfiguration in web.config. During translation from Apache (.htaccess) to IIS (web.config), the 'upload' folder was not granted for access to the webroot. <rule name="Rewrite routed access to assets(img, css, files, js, favicon)" stopProcessing="true"> <match url="^(img|css|files|js|upload|favicon.ico)(.*)$" /> <action type="Rewrite" url="webroot/{R:1}{R:2}" appendQueryString="false" /></rule>
thanks guys for helping me out!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Azlina T |