Answer the question
In order to leave comments, you need to log in
How to redirect different domains from the / directory to the /site directory?
I have hosting from beget at the cheapest rate Blog. There are 2 "slots" for the site, and more specifically, the directories allocated through nginx (like so, I'm not really rummage in this). The goal is to install 2 sites in one directory, but problems arise here. If you install the site in /, then there will be no problems and it will work right away, but if you redirect the video.domain.com domain to the /video/ directory through .htaccess, then css and so on may fall off. How to correctly make such troubles? I don’t really want to spend money, but I would like to have more than 2 pages for the same price. Perhaps you did not understand anything, so write a specific question, and I will answer. (Unless, of course, you have a desire to help me)
Answer the question
In order to leave comments, you need to log in
In short, I did everything through .htaccess
Here is the code:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?sub\.domain\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/dir/
RewriteRule ^(.*)$ dir/$1 [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question