With reference of answer by @TomBrossman here
I need to redirect all domain versions to my default domain i.e.
https://example.com/. By all domain versions I mean
https://www. I don't want
When I add
Redirect line in
httpd.conf. cPanel removes it. After some research I came to know that I've 3 options to change in cPanel environment.
- Pre Main Include
- Pre Virtual Host Include
Post Virtual Host Include
<VirtualHost *:80> ServerName example.com ServerAlias www.example.com **Redirect 301 / https://example.com/ (Cpanel Remove this)** ... </VirtualHost>
Is there anyway I can redirect my domain with
VirtualHost on cPanel? Or even by
domain registrar or
I have a VPS with root access.