Answer the question
In order to leave comments, you need to log in
How to correctly specify the path from the subdomain to the domain?
There is a site site.ru and its subdomain: name.site.ru
In the root folder of the site is the file img.png
How to specify the path to it from the subdomain? I thought it was like this (but no):/../img.png
Answer the question
In order to leave comments, you need to log in
/ is a link to the project root, not the main domain. So the url must be the same as for another domain, i.e. full: site.ru/img/img.png
site.ru/img.png
I don't have an answer, but rather a clarifying question:
There is a site.ru domain, and a m.site.ru subdomain, ...which is physically located in the site.ru/m folder.
In order not to duplicate content, it is necessary that the subdomain "takes" files from the domain.
On the local machine in the subdomain, links like ../images/img.jpg work, but on the server they don't.
The hoster says - write absolute links ( site.ru/images/img.jpg).
In this regard, two questions:
1. how to correctly write a relative path from the subdomain to the domain folder in such a situation (if possible)?
2. Does the load on the server increase when it works with an absolute link instead of a relative one?
(because the hoster says - don't worry, but I don't like this idea)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question