V
V
volk0ff2017-02-17 10:39:22
htaccess
volk0ff, 2017-02-17 10:39:22

Shared media folder for 2 sites. How to do?

8c41b5b6c1bf4f8db9875ea6132cdcef.jpg
So, we have 2 sites foo.ru and bar.ru on hosting . Both sites need a folder, for example, with large videos.
In the picture , the media folder is placed outside the sites.
How to make it so that when requesting a file (for example) foo.ru/media/video.mkv and bar.ru/media/video.mkv the file is taken from the media
root folder . (Just like any other file that is in the media.) As I understand it, for this you can simply put the .htaccess file with the correct redirect into the media folders on the sites . Does anyone know how to do this? Thank you !

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Gritsuk, 2017-02-17
@volk0ff

You can use symbolic links.
In the end, everything will turn out as on your screen, media inside foo.ru and bar.ru will be symbolic links to the media folder, which is on the same level as the site folders

V
Viktor Taran, 2017-02-17
@shambler81

man ln

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question