0
votes

I have a little Webpage set up with a little CakePHP Webapp in it. The CakePHP stuff is in a subdirectory and so I got my .htaccess like this:

<IfModule mod_rewrite.c> 
  RewriteEngine on 
  RewriteRule ^test/subdirectory$ subdirectory/app/webroot
  RewriteRule ^test/subdirectory/(.*)$ subdirectory/app/webroot/$1
</IfModule>

Now navigating to domain.com/subdirectory works, but for my route to login I only get a 404 =(

 Router::connect( '/login', array('controller' => 'users', 'action' => 'login'));

Could you please help me?

//edit: I just tried around a little bit, my other routes like domain.com/controller/action/id don't work either.

1
is that .htaccess file in your web root or in Cake's root?Farray

1 Answers

0
votes

Change your debug level to '2'. At this debug level, Cake will tell you what you're actually missing instead of giving you a 404. For bad rewrite rules, it will probably tell you that you're missing a controller and then it will tell you what path it used when it tried to find your controller. With that info, you should be able to correct your rewrite errors.

Cake is perfectly happy to operate in a subdirectory though, so your simplest option may be to just move your Cake into /test/subdir.