Psycho Posted August 24, 2007 Share Posted August 24, 2007 I'm going to try and explain this the best I can - I hope it is understandable. I'm looking for some ideas and best practices for setting up my sub-domains to make sharing/including common files among different sub-domains easy. Specifically, I am looking for a solution that will make it easy to reference common files in the PHP script as well as referencing common images within the HTML. This is particularly a problem when including files in a PHP script that may include other files - can't use relative pathing. For example, let's say I had this folder structure: mydomain.com | |--sub1.mydomain.com | |--sub2.mydomain.com | |--images | |--includes I could create a $prepath varaible with the value "..\" for the subdomains and "" for the main domain. Then use that to reference all files from the root of the main domain. Of course I would have to reference any images in the HTML with a full path from the main domain only. Again, I hope this all makes sense. Anyone have some common practices or tricks that they use in these situations? Quote Link to comment https://forums.phpfreaks.com/topic/66530-sharing-common-files-between-sub-domains/ Share on other sites More sharing options...
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.