Answer the question
In order to leave comments, you need to log in
How to make a 301 redirect from a www domain to a non-www domain (including a hundred subdomains)?
There is a main domain site.ru and many subdomains moscow.site.ru
All domains are now available from www.
Is it possible to redirect from www to without www at once for the main domain and its subdomains? Or is it necessary to write rules for each domain and subdomain?
Answer the question
In order to leave comments, you need to log in
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question