Cakephp problems with .htaccess

0

I did the project publishing, it ran correctly, however, the other projects that were in the root stopped working, I checked and from what I noticed the problem is in the .htaccess, which is so at the moment:

php_value date.timezone 'America/Sao_Paulo'
<IfModule mod_rewrite.c>
  RewriteEngine     on
  RewriteRule    ^image/(.*)\.[a-zA-Z]{2,4}$ app/webroot/thumb.php?$1 [QSA,L]

  RewriteRule    ^$ app/webroot/    [L]
  RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

If I put the other projects inside the / webroot folder they work but stay with / app / webroot / project URL

    
asked by anonymous 21.08.2014 / 04:31

1 answer

1

I'm guessing that this file is in the main directory ( app ) of your new project. Edited: Your htaccess is at the root of the host .

The .htaccess you posted is rewriting more URLs than you should.

Try changing this file to:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule    ^([^/]+)/image/(.*)\.[a-zA-Z]{2,4}$ $1/app/webroot/thumb.php?$2 [QSA,L]
  RewriteRule    ^([^/]+)$    $1/app/webroot/    [L]
  RewriteRule    ([^/]+)/(.*) $1/app/webroot/$2    [L]
</IfModule> 

The idea here is to capture the main directory of each project at the beginning of each URL and place it before app / webroot . The catch will be in $1 and what was previously in $1 becomes $2 .

    
21.08.2014 / 04:54