yossi
yossi

Reputation: 3164

CakePHP not working as expectetd on apache

(*note the "edit")

I'm following the tutorial (bookmarker) and after datasource config, i get the default page

so far so good. Now i've followed the baking procedure and it was successful. however.. the default page stays!
I'm not routed to the app..

Strangely, using the builtin server (bin\cake server) shows the expected result (accessing localhost:8765/bookmarks).

It seems like an apache issue - but i can't figure it out.

  1. I've verified that i have both .htaccess files in the app (/.htaccess and webroot/.htaccess)
  2. I've verified that the httpd.conf is set to Options FollowSymLinks AllowOverride All
  3. The server was restarted.

I'm using win7 pro & wamp (bitnami's dist)

enter image description here


edit

I've also tried VirtualHost. added to httpd.conf

<VirtualHost *:80>
  ServerName bookmarker
  DocumentRoot "D:\wamp\apache2\htdocs\bookmarker"
  DirectoryIndex index.php
</VirtualHost>

changed the hosts file (127.0.0.1 bookmarker)

Go the same results.

Upvotes: 0

Views: 1165

Answers (2)

Khattu Developer
Khattu Developer

Reputation: 99

Comment these two lines in routes.php file:

$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);

$routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);

And add these lines in routes.php file:

$routes->connect('/:controller/:action/*');

$routes->connect('/:controller/*', ['action' => 'index']);

routes.php file is responsible for your application's routes and redirections.

Upvotes: 1

Hasnat Safder
Hasnat Safder

Reputation: 2495

You need to update your URL rewriting configurations. In your Apache Configuration file (httpd.conf)

use

<Directory />
   AllowOverride none
   Require all denied
</Directory>

Also make sure that rewrite_module is not commented (remove # from beginning).

Upvotes: 1

Related Questions