These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Redirect www to non-www under subdomain on the new forum.
Hi,
I have set redirect from http to https under Virtuamin configuration, now I would like to redirect for all vhosts www to no-www. Is there a setting somewhere?
Under vhost tried:
RewriteEngine On RewriteCond %{HTTP_HOST} ^www.(.)$ [NC] RewriteRule ^/(.)$ https://%1/$1 [R=301,L]
but it doesn't work for subdomain
Thanks,
A sub domain shouldn't have www, This can be set in your sub-domains directives
Services -> Configure Website -> Edit Directives
and remove the line that saysServerAlias www.<your-domain-name>
. You should do the same for SSL if your site is running as an SSL site.Chris: Adelphia Interactive
Desktop: Windows 10 Pro x64
Server: Ubuntu 16.0.4.2LTS
Webmin/Virtualmin: Latest (daily updates)
Hi thanks for the answer, removed the line, however still it is possible to access: https://www.mydomain.com it does not redirect to https://mydomain.com
Ubuntu 18.04 LTS
Mine does that by default. If you go to your site via
www.mydomain.com
does it not automatically redirect you tomydomain.com
without thewww
?Also, after you removed the line did you click the "Apply Changes" button in the top right corner to apply your changes?
Chris: Adelphia Interactive
Desktop: Windows 10 Pro x64
Server: Ubuntu 16.0.4.2LTS
Webmin/Virtualmin: Latest (daily updates)
Yes I did restart Apache, please notice, that I have http to https redirection set under Virtualmin configuration maybe that is why is not working?
Ubuntu 18.04 LTS
Can you post the domain name?
Chris: Adelphia Interactive
Desktop: Windows 10 Pro x64
Server: Ubuntu 16.0.4.2LTS
Webmin/Virtualmin: Latest (daily updates)
Is here a messaging system? :) I do not want to share domain on public forum
Ubuntu 18.04 LTS
Doesn't look like it.
Chris: Adelphia Interactive
Desktop: Windows 10 Pro x64
Server: Ubuntu 16.0.4.2LTS
Webmin/Virtualmin: Latest (daily updates)