harryweiss Posted January 28, 2005 Posted January 28, 2005 I have a site www.mysite.com. I have 3 subdomains sub1.mysite.com, sub2.mysite.com and sub3.mysite.com. sub3.mysite.com is password protected. All pages end with .php (ie index.php) I use the following code: <?php include("inc23.inc"); ?> I find that I will require some of the same includes in more than one subdomain. Can I do the following? 1) Create a subdomain called resources.mysit.com with 3 folders - images, includes and stylesheets and use A. <?php include("resources.mysit.com/includes/ inc23.inc"); ?> B. <link rel="stylesheet" type="text/css" href="resources.mysit.com/stylesheets/stylesheetraw.css" /> Instead of <link rel="stylesheet" type="text/css" href="stylesheetraw.css" /> C. In my style sheet use #toparea {background-image: url(resources.mysit.com/images/images/gs1.gif); etc instead of #toparea {background-image: url(images/gs1.gif); D do I use http:// Since I have an absolute address instead of a relative one, I assume it doesn't matter what's where E Does the fact that one of my subdomains is password protected complicate anything? Thank you Quote
LisaJill Posted January 28, 2005 Posted January 28, 2005 I don't think you can do that, as far as I know our php config doesn't allow for calling URLs in includes. I can't really think of anyway to do this other than using a full path - /home/username/public_html/resources/images... etc I think that would work, anyway. Quote
harryweiss Posted January 28, 2005 Author Posted January 28, 2005 I don't think you can do that, as far as I know our php config doesn't allow for calling URLs in includes. I can't really think of anyway to do this other than using a full path - /home/username/public_html/resources/images... etc I think that would work, anyway. <{POST_SNAPBACK}> Would the fact that one of the subdomains is password protected affect that subdomains ability to access another sub domain or the other subdomain to send to a password protected calling subdomain? Quote
LisaJill Posted January 28, 2005 Posted January 28, 2005 I have no idea, easiest thing to do is try it. =) I don't have a setup where I can try test that at the moment. Quote
borfast Posted January 28, 2005 Posted January 28, 2005 Answering your questions in reverse order... E - I don't think so. Unless you try to access something via http://subdomain.domain.com D - If you want to use the absolute URL then you must use the http:// C - That would work but you'll need to use http:// in the beggining of the URL (see D) B - Same as C A - Ah, the complicated one, finally: No. Seriously, this is the most complex one to answer. Read my post about why using include("http://somedomain.com/include.php") will not work. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.