C
C
cheshirko2018-10-03 03:25:16
Yii
cheshirko, 2018-10-03 03:25:16

How to set up htaccess for yii2 advanced on shared hosting for 2 domains?

The situation is as follows:

There is a project on yii2-advanced.
The external part (frontend/web) and the admin panel (backend/web) are initially separated into different domains.

The main domain (site.com) is configured on the shared hosting and the parking domain for the admin panel (site-admin.com) is added.

How can I make friends with these 2 domains, so that when switching from 1, only the site opens and when switching from another, only the admin panel. In particular, how to set up .htaccess

so far I have only achieved that when you add it to the frontend / web or backend / web address, you can view any of the sections from any domain

. I apologize in advance for the stupid question.

PS VirtualHost in htaccess is not supported on this virtual hosting

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-10-03
@webinar

How can I make friends with these 2 domains, so that when switching from 1, only the site opens and when switching from another, only the admin panel.

Obviously, the transition follows the link and if the link leads to the admin panel, the admin panel will open. I don't understand what you are trying to do.

D
Denis A., 2018-10-03
@myphpscript

You seem to have both domains tied to the project root. In the hoster panel, specify the folder /path to the project/backend/web for site-admin.com, and /path to the project/frontend/web for site.com.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question