chriso20 Posted November 23, 2007 Share Posted November 23, 2007 Hey, I have a development area on my site (eg. http://dev.mysite.com) and i all my content pages include header and footer php files. At the moment they're using relative URLs, but due to my file structure i want to use absolute. But if i change my code from <?PHP include ("../header.php"); ?> to <?PHP include ("http://dev.mysite.com/header.php"); ?> i get a 401 (Authorization Required) error. I was thinking i could change something in my .htaccess to allow SSI? Thanks for any help, Chris Link to comment https://forums.phpfreaks.com/topic/78485-include-absolute-path-in-password-protected-folder/ Share on other sites More sharing options...
trq Posted November 23, 2007 Share Posted November 23, 2007 http:// is a url, not a file path. Link to comment https://forums.phpfreaks.com/topic/78485-include-absolute-path-in-password-protected-folder/#findComment-397154 Share on other sites More sharing options...
chriso20 Posted November 23, 2007 Author Share Posted November 23, 2007 very true, so i should change it to ? \home\public_html\ something like that? Link to comment https://forums.phpfreaks.com/topic/78485-include-absolute-path-in-password-protected-folder/#findComment-397155 Share on other sites More sharing options...
revraz Posted November 23, 2007 Share Posted November 23, 2007 Yes Link to comment https://forums.phpfreaks.com/topic/78485-include-absolute-path-in-password-protected-folder/#findComment-397156 Share on other sites More sharing options...
chriso20 Posted November 23, 2007 Author Share Posted November 23, 2007 Sorry for being stupid - should have realised it had to be file system. Can someone point me in the right direction (or give me a hint) for setting up a global var (if i mean that) so i can link to /siteA/header.php /siteB/header.php instead of what i'm doing now which is: /home/public_html/site/dev/header.php Cheers for your help! Link to comment https://forums.phpfreaks.com/topic/78485-include-absolute-path-in-password-protected-folder/#findComment-397162 Share on other sites More sharing options...
Aureole Posted November 23, 2007 Share Posted November 23, 2007 Just use a constant... define('SITE_PATH', 'something...'); Link to comment https://forums.phpfreaks.com/topic/78485-include-absolute-path-in-password-protected-folder/#findComment-397199 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.