E
E
Egor2020-03-12 17:20:50
htaccess
Egor, 2020-03-12 17:20:50

Redirect from www to non-www, subdomain redirect not working?

At the moment, redirection does not work if the address contains a subdomain of the msk.url type, it works without a subdomain.
I am using the following code:

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$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 question

Ask a Question

731 491 924 answers to any question