A
A
azkaban4ik2017-09-27 13:40:02
htaccess
azkaban4ik, 2017-09-27 13:40:02

How to remove subdomain redirect to www?

There was a question, I made a subdomain on cloudflare, but it does not work due to the fact that it redirects to www. Already tried different options in .htaccess but nothing helps. Can you help me remove this redirect? At the moment, the folder with the subdomain is empty, there is only the .htaccess file

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2017-09-27
@VELIK505

those. so that www.a.mysite.ru opens with a.mysite.ru ?

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

V
Viktor Taran, 2017-09-28
@shambler81

1. First you need to make sure that there is an A record www.a.site.ru
Otherwise, the redirect will not work.
Well, no one bothers you to clarify the condition

RewriteCond %{HTTP_HOST} ^www\.a\mysyte\.ru [NC]
RewriteRule ^(.*)$ https://mysyte.ru/$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