Domain Redirection in VESTA Panel

Below are the steps to redirect domain on Vesta Control Panel:

Step 1 – Install VestaCP on your server

Step 2 – Now login to VestaCP admin and add a new website.

Click on the WEB menu then click Add Web Domain.

Step3- Select​​ a domain name of your choice

Select a domain that you want to forward /redirect then click the green Add button.

Step 4 – Now launch Putty or Terminal up

log in to your server via SSH as root or as a user with sudo privilege (or as admin if you configured admin to have SSH access)

Step 5 – Now go to web directory of your newly added website/domain which it should be at this location:

cd /home/user/web/domain.tld/public_html

(replace user and domain.tld with your own.)

Step 6 – Create a new .htaccess file (or edit it if it’s created already):

nano .htaccess

Step 7 – Now put these lines in there:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^oldsite.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.oldsite.com [NC]
RewriteRule ^(.*)$ https://newsite.com/ [L,R=301,NC]
</IfModule>

Enjoy 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top