Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Website's CSS file in /home/somewhere-else?

Options
  • 14-09-2008 4:39pm
    #1
    Closed Accounts Posts: 12,382 ✭✭✭✭


    Hello

    I have 26 websites which use a common PHP function. The function is in its own /home directory, e.g. /home/common/

    This works fine as I can include /home/common/functions.php in each website's index.php page.

    I would like to do the same for the CSS files. At the moment I need to put the CSS files in the public_html folder for each website. The problem with this is there are now 26 versions of the same file, so one update requires 26 files to be updated. I would like to solve this by putting the CSS file in /home/common/

    I cannot get this to work though. I have the path to the CSS as "../../home/common/mycss.css" which does not seem to be accessible by the index.php pages.

    Is there a simple solution to this?

    Thanks!


Comments

  • Registered Users Posts: 3,594 ✭✭✭forbairt


    this could be a bit of overhead but why not have an include
    <style type="text/css" src="css.php" />

    or something similar ...

    css.php is then just pulls in the css from the shared folder.

    its adding an extra overhead to it all however.

    What about storing the css on 1 server ? and all other files include that style.

    <style type="text/css" src="http://sharedserver.com/main.css&quot; />

    or something like that ?


  • Closed Accounts Posts: 12,382 ✭✭✭✭AARRRGH


    forbairt wrote: »
    What about storing the css on 1 server ? and all other files include that style.

    <style type="text/css" src="http://sharedserver.com/main.css&quot; />

    or something like that ?

    I think that's probably the simpliest solution - thank you!


  • Registered Users Posts: 3,594 ✭✭✭forbairt


    another solution might be to use a symbolic link .. though I'm not sure if that'd work with apache having rights to read from the place you store your css


  • Registered Users Posts: 706 ✭✭✭DJB


    I'm interested to know what you are putting into a css file that'll be shared across 26 sites. Unless all sites look exactly the same that is.

    Dave


  • Registered Users Posts: 3,594 ✭✭✭forbairt


    DJB wrote: »
    I'm interested to know what you are putting into a css file that'll be shared across 26 sites. Unless all sites look exactly the same that is.

    Dave

    jobs dublin .. jobs laois ... jobs ...

    :D I'll assume at least

    I guess he could always have an override css script for each site.


  • Advertisement
  • Subscribers Posts: 9,716 ✭✭✭CuLT


    DJB wrote: »
    Unless all sites look exactly the same that is.

    Try clicking on a couple of links in his sig :)


  • Registered Users Posts: 706 ✭✭✭DJB


    @cult and @forbairt - I think I'm still asleep! :D It is Monday morning after all.

    Well then, I think I would have handled the whole set up differently. Have one set of files for managing all sites. Point all domains to the same set of files. Use a mixture of htaccess and php coding to pull the relevant information from the databases. Then you are only managing one site and one set of files for 26 domains.

    Not exactly the answer to the question but maybe something to think about.

    Right, I'm going back to bed! :D


  • Registered Users Posts: 3,594 ✭✭✭forbairt


    DJB wrote: »
    @cult and @forbairt - I think I'm still asleep! :D It is Monday morning after all.

    ...

    Right, I'm going back to bed! :D

    I've spent most of the morning spacing out ...

    2 coffees and a red bull ... and I think I'm waking up.


Advertisement