Reputation: 1078
I have these 2 constants defined:
define( 'SITE_ROOT',$_SERVER['DOCUMENT_ROOT'] . '/' );
define( 'APP_ROOT', str_replace('\\', '/', dirname(dirname(__FILE__))) . '/' );
My folder structure is like this:
Site_Root (exampledomain.com)
- docs
- tests
- app
- assets
- libs
- core
If I use something like :
$appassets = APP_ROOT.'assets/css/'.$filename.'.css';
it echos the path as:
http://exampledomain.com/var/www/app/assets/css/core.css
How can I get rid of this var/www/
bit from the echoed path?
I want the value of 'SITE_ROOT' to be 'http://exampledomain.com/'
and the value of 'APP_ROOT' to be 'http://exampledomain.com/app/'
How can I achieve this?
Upvotes: 0
Views: 1968
Reputation: 157941
define( 'APP_ROOT', '/app/');
if you really need a constant for this
Upvotes: 2