Redirecting WWW to NON-WWW is very important for SEO and I miss it a lot as a default option in HestiaCP.
I know it can be done implementing this, but since I already redirected HTTP to HTTPS from that check option when I added my website, now I don’t know what the exact file I need to go, and what block I should edit, should it be better to add a new block instead for better performance or edit the existed block. There are many of them in these files which made me confused!
Thanks, Dmitry! But that didn’t work for me, I ended up with that black page error! Not sure if this is related but I didn’t install Apache, I’m just using Nginx instead.
By the way, should nonwww.tpl I’ve created be empty and only put the snippet you gave in the stpl version?
The above code was copied incorrectly for me and cannot be edited. Try to take this code on pastebin:
I am using Nginx + php-fpm.
The tpl and stpl files should be roughly similar to each other.
I can show my template for wordpress as an example:
wordpress2.tpl - https://pastebin.com/qFL5m0Dg
I showed an example of implementing a redirect from www to non-www in HestiaCP templates. I hope this helps you create your own template for your needs.