S
S
Shandy2020-11-28 14:47:50
htaccess
Shandy, 2020-11-28 14:47:50

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

2 answer(s)
S
Shandy, 2021-01-19
@MrShandy

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]

K
ky0, 2020-11-28
@ky0

The simplest VPS from 2-3 dollars a month - and no restrictions on "slots", "directories" and other turbidity, the place of which has long been in the dustbin of history :) At least start a hundred domains.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question