Answer the question
In order to leave comments, you need to log in
Is it possible to bind a domain to a specific site folder?
There is such a problem - to bind the domain to the hosting.
We have
- domain;
- hosting on the 3rd level domain (not yukoz, etc.);
- sub.site.ru has the same IP as site.ru
Is it possible to bind a domain to a specific folder of a site such as sub.site.ru/razdel ? It is possible to move a section to a subdomain - razdel.sub.site.ru. If possible, how (preferably in more detail).
The method with URL masking (the site opens in a frame) does not work.
Redirect method 302 fails.
Answer the question
In order to leave comments, you need to log in
Hosting has any control panel? Everything is done through her.
If there is no panel and it is vds / vps, then you need to register it in the apache / nginx configs
If the partition is just a folder, then ask the admins to change the docroot.
If the section is "created" by a different CMS, then you will have to make a tricky construction with nginx like this:
server {
...
server_name razdel.sub.site.ru
location / { rewrite (.*) /razdel/$1 last;
}
location /razdel {
proxy_pass http://гдетамувасапач;
proxy_set_header Host sub.site.ru;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location <регулярка для статики> { root /путь/до/статики;}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question