A
A
andruxin2013-11-22 15:16:46
Domain Name System
andruxin, 2013-11-22 15:16:46

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

5 answer(s)
S
Stepan, 2013-11-22
@L3n1n

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

K
kodi, 2013-11-22
@kodi

@andruxin do you have access to the webserver configs?

D
Dmitry Galushka, 2013-11-22
@diger

301 redirect is great for your task

V
Vlad Zhivotnev, 2013-11-22
@inkvizitor68sl

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 /путь/до/статики;} 
}

Or similar in Apache, but there it will work disgustingly.

Q
Quber, 2013-11-23
@Quber

If you do not have access to a second-level domain, then in no way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question