Answer the question
In order to leave comments, you need to log in
How to make a redirect from the page of the main site site.ru/example to the subdomain example.site.ru?
How to make a redirect from the page of the main site site.ru/example to the subdomain example.site.ru?
1. Created a subdomain example.site.ru, attached to the existing one.
in .htaccess at the root of the main site I wrote:
RewriteEngine On
RewriteBase /
#адрес поддомена
RewriteCond %{HTTP_HOST} ^(www\.)?example\.site\.ru$ [NC]
#папка на которую будет происходить переадресация
RewriteCond %{REQUEST_URI} !^/example/
#сама переадресация
#RewriteRule ^(.*)$ example/$1 [R=301, L]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question