apache2 - CakePHP HTML helper CSS tag and Apache Alias -
as relative newcomer cakephp, i'm hoping advice on "right" way of configuring apache , cakephp find included files (css, javascript, etc).
if server's documentroot
set /var/www
, install , configure cakephp in /var/www/somepath/cakeapp
can access application expected @ url http://example.com/somepath/cakeapp.
however, if use html helper generate css link tag in default layout, start run trouble. example, code
echo $html->css('styles');
produces tag:
<link rel="stylesheet" type="text/css" href="/somepath/cakeapp/css/styles.css" />
however, css lives in /somepath/cakeapp/app/webroot/css
.
if cakephp app thing on domain, point documentroot
@ /var/www/somepath/cakeapp/app/webroot
documentation suggests , (presumably) well. however, that's not option me.
is there accepted correct way of configuring apache , cakephp html helper can produce correct link tag?
edit: feel there must combination of cakephp configuration , apache aliases haven't run across yet.
/somepath/cakeapp/css/styles.css
correct path needs displayed in links.
the reason why gets displayed such because of .htaccess file in cakeapp directory redirects (rewrites) requests cakeapp/app/webroot directory.
now, reason why structure exists because generally, have "public" , "non-public" parts in application. "non-public" parts contain php code including controllers, models, views, plugins, cake library, etc. "public" parts include css, scripts, , image files.
now, could make /var/www/html folder app directory make secure. in order configure application liking, check cakeapp/app/bootstrap.php file , change relevant settings. can learn more here.
in short, no worries. path see right!
Comments
Post a Comment