R
R
RoffDaniel2020-08-07 10:48:46
PHP
RoffDaniel, 2020-08-07 10:48:46

How to make part of the address a subdomain?

Hello. There is a site with various pages with different interfaces, a control panel, etc. There is a domain - domain.com, displays the main pages of the site / project. And there is an account control panel - domain.com/xid/. Please tell me how can I make "xid.domain.com" from "domain.com/xid/"? ServerAlias ​​in apach and nginx is configured, wildcart certificate is received, A record is created, I redirect from the url using:

RedirectMatch 301 ^/xid/(.*)$ https://xid.domain.com/$1


But the problem is this, when redirecting, it shows me the contents of the main page of the site, and not the panel as I need it. For information: the site is written in php using OOP, DI containers and composer. Links are created using routes

PS: for a long time I wanted to delve into this issue, how to still display the same site on subdomains with different content, but, as you can see, without success...

Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2020-08-07
@RoffDaniel

In the application itself, it means that the work of subdomains has not been released.
Check the domain for which the request came.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question