
: Is this possible: Use css from other virtual host? So my questions is as follows: Say I have a website at /var/www/Electrician and I have a website at /var/www/Restaurant. If these websites
So my questions is as follows:
Say I have a website at /var/www/Electrician and I have a website at /var/www/Restaurant.
If these websites use separate host files can I use the same CSS to reduce space?
If I am not mistaken I would certainly be unable to do ../../css/style.css because the one host is restricted from accessing the other, I would imagine.
I can see putting the one website into the other website directory, but I see that leaving room for cross-site issues.
I will admit I am doing a poor job explaining this. Essentially I would like to share CSS stylesheets between to separate websites on the same server, which will employ separate host files.
I appreciate you for taking the time for having read this, if you can provide assistance more praise is underway!
More posts by @Barnes591
1 Comments
Sorted by latest first Latest Oldest Best
Yes, but as you already guessed you wouldn't be able to use relative paths because that would take you outside of the web root. You you would need to use the full URL to the CSS file to reference it in a different site:
So instead of ../../css/style.css you would do example.com/css/style.css.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.