0
After extracting cake 2.5.2 to the directory (Linux) /var/www/html/teste
when accessing the url http://localhost/teste
it loads the contents correctly from the controller pages
and action display
according to the file routes.php
:
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
But when trying to access the controller directly from the url :
http://localhost/teste/pages/display
have Return 404 from Page not found.
Other than that(rs), the css/js/img
webroot (not being included by the generated url) are not loaded.
Generated url that returns file not found:
http://localhost/teste/css/cake.generic.css
Url to access the file correctly:
http://localhost/teste/app/webroot/css/cake.generic.css
My solution for the css/js/img files was the following, I changed the way to call the file.
Standard form used:
echo $this->Html->css('cake.generic');
New form:
echo $this->Html->css('/app/webroot/css/cake.generic.css');
In short, I think maybe the error really is in apache or something like that, but I don’t know exactly how I can validate that part.
My solution for css/js/img, is that correct? Because I think it was supposed to work like the example I downloaded in the cake version correctly.
In case you need more information just say the word, thanks.
Alessandro, the display method cannot be called, it is a "subcontroller" it does not render anything, only directs to the correct view.
– Marcelo Aymone