How to use the same files for different domains

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
kiberdemon
Posts: 10
Joined: Thu Mar 09, 2017 6:53 am

How to use the same files for different domains

Postby kiberdemon » Tue Aug 29, 2017 9:43 am

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

mehargags
Moderators
Posts: 786
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: How to use the same files for different domains

Postby mehargags » Wed Aug 30, 2017 7:35 pm

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.

skurudo
VestaCP Team
Posts: 7798
Joined: Fri Dec 26, 2014 2:23 pm
Location: Moscow
Contact:

Re: How to use the same files for different domains

Postby skurudo » Thu Aug 31, 2017 11:14 am

Why not use alias for domain1 ?
-> DigitalOcean competition - please, support us
-> fix for phpmyadmin - nice and sweet now


Return to “Web Server”



Who is online

Users browsing this forum: Yandex [Bot] and 5 guests

cron