Page 1 of 1

How to use the same files for different domains

Posted: Tue Aug 29, 2017 9:43 am
by kiberdemon
I need one system:

1 Domain1.ru
2 Domain2.ru

but the files are identical

But it uses one file for all the index.php files in the domain.

How can I implement this function, taking into account the use of CSS and JS, as well as php

Only for php I can use include or require_once, but how to do this for CSS and JS

Re: How to use the same files for different domains

Posted: Wed Aug 30, 2017 7:35 pm
by mehargags
Not very clear on what you are trying to achieve but if the second site is an exact copy of the first one, you may symlink
secondsite/public_html to firstsite/public_html

Code: Select all

ln -s full-path-to-firstsite/public_html full-path-to-secondsite/public_html
This was you won't need to maintain two copies, any changes on first one will reflect on 2nd one. Also make sure to host both domains under one VestaCP user to avoid permission problems.

Re: How to use the same files for different domains

Posted: Thu Aug 31, 2017 11:14 am
by skurudo
Why not use alias for domain1 ?