Mobile app version of vmapp.org
Login or Join
Merenda212

: Domain redirection with virtualhost on cpanel environment With reference of answer by @TomBrossman here I need to redirect all domain versions to my default domain i.e. https://example.com/. By

@Merenda212

Posted in: #301Redirect #Apache2 #Virtualhost

With reference of answer by @TomBrossman here

I need to redirect all domain versions to my default domain i.e. example.com/. By all domain versions I mean www, and www. I don't want htaccess redirect.

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 example.com **Redirect 301 / example.com/ (Cpanel Remove this)**
...
</VirtualHost>



Is there anyway I can redirect my domain with VirtualHost on cPanel? Or even by domain registrar or DNS setting?

I have a VPS with root access.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Merenda212

1 Comments

Sorted by latest first Latest Oldest Best

 

@Murray432

Have you used the options in the 'Redirects' section of cPanel?
You can add a Permanent(301) redirect for the More info can be found here...

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme