W
W
WeStlik2020-08-26 00:53:55
htaccess
WeStlik, 2020-08-26 00:53:55

How to make subdomains on a separate IP address?

I welcome everyone!
And so, I implemented auto-subdomains through the .htaccess file:

RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.sitename\.ru$
RewriteCond %{HTTP_HOST} ^(.*)\.sitename\.ru$
RewriteRule ^(.*)$ http://sitename.ru/blog.php?user=%1 [L,P]


Everything works fine, but I need to bind a custom domain to this subdomain.
Those. so that the subdomain user1.sitename.ru opens on the purchased domain user1.ru
How can this be implemented? IP addresses, aliases - the same for the main domain and any of the subdomains

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kocherman, 2020-08-26
@kocherman

In order to display one site at another address, you need a proxy . Try to raise on your domain, for example, google.com.
The entire script is from a single php file , to which all requests must be redirected via .htaccess.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question