Answer the question
In order to leave comments, you need to log in
How can I amend the rule so that it applies to 3rd level domains?
There is a rule for redirecting from http and www to https without www, but it doesn't work for 3rd level domains, and I don't know how to add it correctly.
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} ^www\.(.+)$
RewriteRule (.*) https://%1/$1 [R=301,L]
Answer the question
In order to leave comments, you need to log in
RewriteCond %{HTTP_HOST} ^www\.(.+)\.(.+)$
RewriteRule (.*) https://%1/$1 [R=301,L]
this will be for only the third level
You can even try to merge
RewriteCond %{HTTP_HOST} ^www(\.(.+)){1,2}$
RewriteRule (.*) https://%1/$1 [R=301,L]
But judging by the regular expression, it should have been there anyway work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question