0

I have CakePHP project placed on the subdomain on multihosting with the following path to the app directory.

/www/domains/sub.domain.com

The problem is that all links in the app are changed to:

https://sub.domain.com/domains/sub.domain.com/health-check

instead of the:

https://sub.domain.com/health-check

CakePHP .htacess has the following format:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^(\.well-known/.*)$ $1 [L]
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

I tried to set some rewrite rules but without the luck.

Thanks for any advice.

redrom
  • 11,502
  • 31
  • 157
  • 264
  • When you say "CakePHP project...with the following path to the app directory", can you be a little more clear about exactly what the "app directory" is? Cake3 doesn't really have an "app directory", so I'm wondering where you've put things like the `src`, `vendor` and `webroot` directories, or their contents, relative to this structure. – Greg Schmidt Nov 27 '18 at 02:09
  • 1
    Possible duplicate of [CakePHP subdomains with htaccess](https://stackoverflow.com/questions/30002125/cakephp-subdomains-with-htaccess) – Sehdev Nov 27 '18 at 06:53
  • Directories src, vendor, webroot are situated in /www/domains/sub.domain.com/ – redrom Nov 27 '18 at 08:11
  • Can you try adding `RewriteBase /www/domains/sub.domain.com` below `RewriteEngine on`? – Marijan Nov 28 '18 at 10:06

0 Answers0