Let me clarify the issue. My document root is something like /var/www/. I have the following two files, /var/www/index.php and /var/www/foo/index.php. I have a CSS file /var/www/css/styles.css. In both index.php files, I want to include the CSS file. In the link tag, I can set href to href="<?= $_SERVER['DOCUMENT_ROOT'] ?>css/styles.css"
for both files. The only issue is now if someone views the source, they see /var/www/css/styles.css. I'd prefer that in the first index.php they would see css/styles.css and in the foo/index.php they would see ../css/styles.css.