V
V
Vadim Timoshenko2018-05-23 16:27:24
Apache HTTP Server
Vadim Timoshenko, 2018-05-23 16:27:24

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

1 answer(s)
V
Viktor Taran, 2018-05-23
@PbI6A_KuT

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