D
D
dexashop2016-10-08 02:03:30
htaccess
dexashop, 2016-10-08 02:03:30

How to make a subdomain using htaccess?

Hello, there is a domain of the form - valera.kolya.ru
How to make a subdomain - sasha.valera.kolya.ru using htachess? There will be many such subdomains, we need a universal version.
Thanks in advance for your replies

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2016-10-08
@xmoonlight

Поддомены делаются на DNS-сервере.
Добавьте А-запись:
*.valera. A XX.XX.XX.XX

Антон, 2016-10-08
@Anton2022

Копайте в таком направлении:

RewriteEngine On
RewriteBase /
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^new\.site\.ru$
RewriteCond %{REQUEST_URI} !/new/
RewriteRule ^(.*)$ /new/$1 [L]

В конечном итоге, всё, что будет в папке ./new/ должно откликаться на new.site.ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question