A
A
Alexey Nikolaev2016-06-20 15:28:40
System administration
Alexey Nikolaev, 2016-06-20 15:28:40

Why on the server can one file in fact refer to another file in another folder?

Good day.
There is a domain and a subdomain, on the server they are, respectively, decomposed into two different folders. The structure is this:

\
 |- domain.com
 |- dev.domain.com
 |- another-domain.com

Dev-domain is the same site as domain.com, only intended for development. Accordingly, the file structure in these two directories is the same.

The problem is that the custom.css file in dev.domain.com somehow refers to the exact same file in domain.com (and vice versa). That is, if, for example, you make changes to the dev.domain.com/custom.css file , the changes will be visible in the browser on domain.com , and vice versa. At the same time, all other files work as expected!

There is a solution to the problem - just created another file. But I really want to understand why this can be? I'm not very strong in system administration, maybe I'm missing something pretty obvious?

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-06-20
@alsopub

Options:
1) A symbolic (or even hard) link on the disk from /dir1/file.css to /dir2/file.css
2) A line in the web server config that "overwrites" one folder (or file) with another.
3) The same as in point 2, only it works for non-existent files like try_files and nginx.
I'm leaning towards 1 or 3.

M
Moskus, 2016-06-20
@Moskus

The above has already described how it works, but did not describe why. Why - you need to ask the one who set up the server. But in general, if this is not someone's mistake, this is done so that the same file does not need to be copied to several places.
In fact, there is another option - if the site uses some kind of engine, its own configuration in the second instance (which is dev.domain.com) can simply be copied from the first one, and an absolute path can be given there. This is mistake.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question