How to config htaccess to deploy cake 3.3 in subfolder

How do I install CakePHP 3.3 in a subdirectory? So far, I’ve only found that I should set my htaccess in app2/.htaccess, but I’ve tried every path I can think of, but only get 500 error.Overview of how it should end up:

User goes to www.example.com and gets my ‘app1’ CakePHP 3 application. User goes to www.example.com/app2 and gets my ‘app2’ application (standard PHP for now, but eventually another Cake app).

My .htacess file:

RewriteEngine on
RewriteBase /app2
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]

app2/webroot/.htacess file:

RewriteEngine On
RewriteBase /app2
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]

What am I missing? Are there other steps I need to take? Is what I’ve done so far incorrect?

Did you find a solution? I am having the same problem.

No. I didn’t. Now, I use laravel !

do you want to change http to https … or smthing else ?

I think you don’t have to switch to laravel because of this issue :slight_smile:

CakePHP works just like described in the cookbook. In my case the problem was the communication between me and the SysAdmin who had to change the Apache-Config.

For me, adding RewriteBase /subfolder/ did the job - after several days of waiting for the SysAdmin to activate

Options FollowSymLinks
AllowOverride All

in the Apache-configuration.

1 Like