Mobile app version of vmapp.org
Login or Join
Barnes591

: 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

@Barnes591

Posted in: #Css #Nginx #Virtualhost #WebDevelopment #WebHosting

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!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Barnes591

1 Comments

Sorted by latest first Latest Oldest Best

 

@Kristi941

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme