So, I've searched and found some simillar questions, but none of the answers worked for me.
Let me explain the situation. I've built a CakePHP 3 and it works great in my local machine. When I finally deployed to the server, things got really weird.
Basically, when I use the link() or css() or other methods of the Html Helper, CakePHP adds the whole path (starting from the root). So, I'd write something like:
<?= $this->Html->css( 'main.css' ) ?>
and the output should be:
<link rel="stylesheet" href="/css/main.css"/>
but what I'm getting is this:
<link rel="stylesheet" href="/var/www/html/mydomainname.net/web/css/main.css"/>
I did some research on the hosting company FAQs and documentation, and I found out that the Apache DocumentRoot is set to the '/', which is of course not desired, since CakePHP requires it to be set to the app's web root folder. The thing is, since this is a shared hosting environnment, I cannot change it!
Any ideas?
$this->request->base,$this->request->webroot,Configure::read('App'), and$_SERVER. - ndm