U
U
Uzair Izha2019-01-10 12:12:46
PHP
Uzair Izha, 2019-01-10 12:12:46

How can I make the subdomain refer to the main domain, but at the same time the address bar should contain the name of the subdomain?

I have a 2nd level domain to2.site.ru, I need when a user visits this address, he gets straight to the domain, but the domain itself would refer to site.ru its index page.
I need to replace the DocumentRoot of the to2.site.ru domain. How can this be done through .htaccess or php?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey Goryachev, 2019-01-10
@webirus

And there are no ordinary alias? apache config:

<VirtualHost *:80>
        ServerName site.ru
        ServerAlias www.site.ru www1.site.ru www2.site.ru
</VirtualHost>

T
ThunderCat, 2019-01-10
@ThunderCat

https://www.namecheap.com/support/knowledgebase/ar...
google wildcard subdomain

V
Viktor Taran, 2019-01-10
@shambler81

alias, you were wrongly written at the top

S
Sergey S., 2019-01-11
@seganim

Link the subdomain to the same site as the main domain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question