As a relative newcomer to CakePHP, I'm hoping for some advice on the "right" way of configuring Apache and CakePHP to find included files (CSS, JavaScript, etc).
If my server's DocumentRoot
is set to /var/www
and I install and configure CakePHP in /var/www/somepath/cakeapp
I can access the application as expected at the URL http://example.com/somepath/cakeapp.
However, if I use the HTML helper to generate the CSS link tag in my default layout, I start to run into trouble. For example, the code
echo $html->css('styles');
produces this tag:
<link rel="stylesheet" type="text/css" href="/somepath/cakeapp/css/styles.css" />
However, the CSS actually lives in /somepath/cakeapp/app/webroot/css
.
If the CakePHP app were the only thing on my domain, I could point the DocumentRoot
at /var/www/somepath/cakeapp/app/webroot
as the documentation suggests and all would (presumably) be well. However, that's not an option for me.
Is there a generally accepted correct way of configuring Apache and CakePHP so that the HTML helper can produce the correct link tag?
Edit: I feel there must be some combination of CakePHP configuration and Apache Aliases that I haven't run across yet.