Cakephp- Problem creating/displaying views
I've been reading this tutorial of how to build a simple blog using cakephp :
http://book.cakephp.org/view/1536/Creating-Post-Views
I followed the instructions "to the letter" but I haven't been able to access my "views"(index, view):
- http://localho开发者_JS百科st/blog/posts/index
- http://localhost/blog/posts/view/1
In both cases I got the same message :
- Oops! This link appears to be broken.(in chrome)
- The webpage cannot be found (IE)
EDIT:
I kept reading the tutorial and when I got to this part:
book.cakephp.org/view/1541/Routes
I started to play with the definition of the default root route (app\config\routes.php):
Router::connect('/', array('controller' => 'posts', 'action' => 'index'));
Router::connect('/', array('controller' => 'posts', 'action' => 'add'));
Router::connect('/', array('controller' => 'posts', 'action' => 'edit',3));
and much to my surprise, now I was finally able to see those views, does any of this gave you any idea what the problem could be? and regarding to the httpd.conf file, I found two files with the same name and I must admit I have no idea which one you are referring to :
- C:\wamp\bin\apache\apache2.2.8\conf\httpd.conf
- C:\wamp\bin\apache\apache2.2.8\conf\original\httpd.conf
It looks to me like something isn't quite right with the mod_rewrite. If it were, the links to the posts controller would say the controller was missing or the view was missing, etc.
The first thing I would check would be that your httpd.conf section concerning the Directory where your files are stored allows htaccess overrides. If it says none, set it to all, then restart apache.
http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride
精彩评论