Y
Y
Yuri Yurin-Komarov2016-04-25 15:09:09
htaccess
Yuri Yurin-Komarov, 2016-04-25 15:09:09

How to correctly set up a synonym redirect to the site folder while saving the synonym URL?

Good day!
There is a main domain of the form xxx.ru
A synonym demo.xxx.ru has been added to it
How to configure .htaccess correctly so that when accessing demo.xxx.ru, the data is taken from xxx.ru/demo, but with the preservation of the URL demo.xxx.ru?
Sincerely, Me!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2016-04-26
@shambler81

RewriteCond %{HTTP_HOST} ^(www|\.)demo\.site\.ru [NC]
# если хост демо или он же с ввв
 RewriteRule ^(.*)$ http://site.ru/demo/$1 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question