Forum Moderators: not2easy
example1.com...and all share a common layout so we would like to create and use a single, common stylesheet file. The trick is that we want to have one and only one file, not duplicates spread across different domain directory structures.
example2.com
example3.com
I realize there are a number of options here, such as having the files refer to a single site source file -- for example, have the
.htmfiles on example2.com and example3.com use an
@import url("http://example1.com/css/common.css");which refers us to the example1.com domain, but we really don't want to take that route, and feel we shouldn't have to since the domains are all hosted on the same server. Rather than duplicate the
common.cssfile, how do you handle the situation?
Put all your stylesheets in a folder, anywhere you like. Could be under example1.com's root, or as a sibling to all three domains.
Assuming IIS, in the admin tool, go to each domain and create a New -> Virtual Directory. Name it something creative like "Styles" and point it to the physical folder you created (above). If in the step above you put the folder under example1.com, then you do not need to do this for example1.com.
Now just make sure alll your pages look for "/Styles/someSheet.css".
I think "all the domains on the same server", is a bit of a red herring.
Off topic, but I'll offer an explanation. One company owns and operates all of the domains and have opted to do so on their own server. The company chooses to own and operate a single server to minimize maintenance and management costs. There is a mirrored backup for disaster recovery, of course. Apache's virtual hosts option is a perfect fit for this type of setup, and indeed part of the Apache developers intentions/design.
which have nothing in the world to do with CSS
Welcome to WebmasterWorld, Guilt_Puppy.
I humbly disagree. If you have ever faced this type of problem and are developing for a similar situation I think you will quickly realize that other developers have probably faced this more often than expected and if they haven't worked it out on their own, they have probably brainstormed a solution with other folks in their enviroment, possibly system administrators or otherwise. That's the folks I'm hoping will spot this thread and contribute ;)
Lance,
This is an option that another respected peer has suggested (except it's a symlink on a *nix server running Apache). I think this is going to be the best route as well but wanted to get feedback from the community.